Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Brave Ads users to choose between 0, 1, 2, 3, 4, 5 or 10 maximum ad notification per hours #16228

Closed
tmancey opened this issue Jun 3, 2021 · 2 comments · Fixed by brave/brave-core#9011
Assignees
Labels
enhancement feature/ads OS/Android Fixes related to Android browser functionality OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass - Android ARM QA Pass-macOS QA/Yes release-notes/include

Comments

@tmancey
Copy link
Contributor

tmancey commented Jun 3, 2021

No description provided.

@stephendonner
Copy link

Verified PASSED using the testplan at brave/brave-core#9011 with

Brave 1.27.77 Chromium: 91.0.4472.114 (Official Build) beta (x86_64)
Revision 4bb19460e8d88c3446b360b0df8fd991fee49c0b-refs/branch-heads/4472@{#1496}
OS macOS Version 11.4 (Build 20F71)

Confirm users do not see ad notifications if ads per hour are set to 0 in brave://rewards

Steps:

  1. launched Brave using --enable-logging=stderr --vmodule="*/variations/*"=6,"*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=3
  2. opened a new-tab page
  3. clicked on Start using Rewards
  4. loaded brave://rewards/
  5. clicked on the Settings icon and chose 0 ads per hour for Maximum number of ads displayed
Screen Shot 2021-06-23 at 11 44 23 AM

Confirmed I didn't see any ads, and noted this in the logs:

[33320:259:0607/114010.218045:VERBOSE2:permission_rule_util.cc(23)] You have exceeded the allowed ads per hour

[33320:259:0607/114010.218114:VERBOSE1:ad_notification_serving.cc(177)] Ad notification not served: Not allowed

[33320:259:0607/114010.218162:VERBOSE1:ad_notification_serving.cc(90)] Ad notification not delivered

Confirm the default ad notification per hour is set to 5 for fresh installs

Steps:

  1. launched Brave using --enable-logging=stderr --vmodule="*/variations/*"=6,"*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=3
  2. opened a new-tab page
  3. clicked on Start using Rewards
  4. loaded brave://rewards/
  5. clicked on the Settings icon
  • Confirmed for fresh installs 5 ads per hour is set for Maximum number of ads displayed in
    brave://rewards
  • Confirmed that I saw and was rewarded for 5 ads, about 1 every 12 minutes.
Screen Shot 2021-06-07 at 11 45 41 AM

Confirm the ad notifications per hour is persisted across browser launches

Steps:

  1. launched Brave using --enable-logging=stderr --vmodule="*/variations/*"=6,"*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=3
  2. opened a new-tab page
  3. clicked on Start using Rewards
  4. loaded brave://rewards/
  5. clicked on the Settings icon and chose 3 ads per hour for Maximum number of ads displayed
  6. waited until 12:54
  7. resumed activity
  8. viewed and clicked on 1st ad notification
  9. waited until 13:34
  10. resumed activity
  11. viewed and clicked on 2nd ad notification
  12. waited until 13:56
  13. resumed activity
  14. viewed and clicked on 3rd ad notification
  15. confirmed I was rewarded for all 3 ads
  16. waited until 14:04
  17. resumed activity
  18. confirmed I was NOT eligible for another ad:
example example
Screenshot 2021-06-23 at 13 59 21 Screenshot 2021-06-23 at 13 59 23
[878:259:0623/135810.581078:VERBOSE2:permission_rule_util.cc(23)] Ad cannot be shown as minimum wait time has not passed
[878:259:0623/135810.581174:VERBOSE1:ad_notification_serving.cc(90)] Ad notification not served: Not allowed due to permission rules

Confirm users are rewarded for seeing new-tab page sponsored images

Steps:

  1. launched Brave with --enable-logging=stderr --vmodule="*/variations/*"=6,"*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6
  2. opened new tab pages until I got a sponsored image
  3. clicked Start using Rewards
  4. checked logs & Rewards widget
  5. restarted
  6. checked Rewards widget

Confirmed I was rewarded for viewing the new-tab page sponsored image:

[9552:259:0623/112901.148094:VERBOSE3:new_tab_page_ad_event_served.cc(24)] Served new tab page ad with uuid 7bab0160-0bcc-4172-8174-d9326a80571d and creative instance id 33b91c8d-fcf7-4799-8547-c22eefdcfa2b

[9552:259:0623/112901.148283:VERBOSE3:new_tab_page_ad_event_viewed.cc(24)] Viewed new tab page ad with uuid 7bab0160-0bcc-4172-8174-d9326a80571d and creative instance id 33b91c8d-fcf7-4799-8547-c22eefdcfa2b

[9552:259:0623/112901.148648:VERBOSE1:confirmations.cc(90)] Confirming view ad for creative instance id 33b91c8d-fcf7-4799-8547-c22eefdcfa2b

[9552:259:0623/112901.206612:VERBOSE6:new_tab_page_ad_event_served.cc(32)] Successfully logged new tab page ad served event

[9552:259:0623/112901.217370:VERBOSE6:new_tab_page_ad_event_viewed.cc(32)] Successfully logged new tab page ad viewed event

[9552:259:0623/112901.305491:VERBOSE1:confirmations.cc(250)] Successfully redeemed unblinded token with confirmation id ba20996c-7a5e-4ee8-bc9c-02900140846e, creative instance id 33b91c8d-fcf7-4799-8547-c22eefdcfa2b and view

[9552:259:0623/112901.369765:VERBOSE1:confirmations.cc(273)] Added 1 unblinded payment token with an estimated redemption value of 0.01 BAT, you now have 2 unblinded payment tokens
example example example
Screen Shot 2021-06-23 at 1 28 03 PM Screen Shot 2021-06-23 at 1 28 07 PM Screen Shot 2021-06-23 at 1 29 23 PM

Confirm users see a maximum of 10 ads per hour if ads per hour are set to 10 in brave://rewards

Steps:

  1. launched Brave using --enable-logging=stderr --vmodule="*/variations/*"=6,"*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=3
  2. opened a new-tab page
  3. clicked on Start using Rewards
  4. loaded brave://rewards/
  5. clicked on the Settings icon and chose 10 ads per hour for Maximum number of ads displayed
example example
Screen Shot 2021-06-07 at 11 46 50 AM Screen Shot 2021-06-23 at 9 43 39 AM
[6403:259:0623/094312.449035:VERBOSE1:seen_ads.h(29)] All ad_notifications have been shown, so round robin

[6403:259:0623/094312.449090:VERBOSE1:client.cc(370)] Resetting seen ad_notifications

[6403:259:0623/094312.449464:VERBOSE2:exclusion_rule_util.h(26)] creativeInstanceId 6f5decfc-57cb-4a42-8523-e372c7d4adff has exceeded the frequency capping for perHour

[6403:259:0623/094312.451715:VERBOSE2:exclusion_rule_util.h(26)] campaignId d1e25388-b362-4f30-bd4b-36b8205e59e5 has exceeded the frequency capping for dailyCap

[6403:259:0623/094312.451796:VERBOSE2:exclusion_rule_util.h(26)] creativeInstanceId 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed has exceeded the frequency capping for perHour

Confirm users resume seeing ad notifications once the ads-per-hour-cap time period is reset

Following in the same session from the above steps, I confirmed I saw the 11th ad, after the 60-minute mark elapsed, and was rewarded for viewing it:
example example
Screen Shot 2021-06-23 at 10 51 24 AM Screen Shot 2021-06-23 at 10 51 38 AM
[6403:259:0623/104830.520161:VERBOSE1:eligible_ad_notifications.cc(147)] Get eligble ads for untargeted segment

[6403:259:0623/104830.525955:VERBOSE1:ad_notification_serving.cc(112)] Found 1 eligible ads

[6403:259:0623/104830.527521:VERBOSE3:ad_notification_event_served.cc(25)] Served ad notification with uuid 166a173a-70d8-43d6-9367-d610c8583734 and creative instance id 6f5decfc-57cb-4a42-8523-e372c7d4adff

[6403:259:0623/104830.527688:VERBOSE3:ad_notification_event_viewed.cc(24)] Viewed ad notification with uuid 166a173a-70d8-43d6-9367-d610c8583734 and creative instance id 6f5decfc-57cb-4a42-8523-e372c7d4adff

[6403:259:0623/104830.527960:VERBOSE1:confirmations.cc(90)] Confirming view ad for creative instance id 6f5decfc-57cb-4a42-8523-e372c7d4adff

[6403:259:0623/104830.543261:VERBOSE1:ad_notification_event_served.cc(33)] Successfully logged ad notification served event

[6403:259:0623/104830.544558:VERBOSE6:ad_notification_event_viewed.cc(32)] Successfully logged ad notification viewed event

[6403:259:0623/104830.963676:VERBOSE1:confirmations.cc(250)] Successfully redeemed unblinded token with confirmation id 1ec07781-ca1c-4aa7-96bf-e52cbff9ed91, creative instance id 6f5decfc-57cb-4a42-8523-e372c7d4adff and view

[6403:259:0623/104830.964156:VERBOSE1:confirmations.cc(273)] Added 1 unblinded payment token with an estimated redemption value of 0.01 BAT, you now have 1 unblinded payment tokens

@srirambv
Copy link
Contributor

Verification passed on OnePlus 6T with Android 10 running 1.27.107 x64 build
Confirm users do not see ad notifications if ads per hour are set to 0 in brave://rewards/ads-settings

  • Verified no ads are shown when ads per hour is set to 0
2021-07-23 06:19:28.653 12950-12950/? V/chromium: [VERBOSE1:ad_notification_serving.cc(136)] Maximum ads per hour changed to 0

Confirm the default ad notification per hour is set to 5 for fresh installs

  • Verified setting ads to 5 ads per hour shows notification every 12 mins
2021-07-23 06:30:20.953 12950-12950/? V/chromium: [VERBOSE1:ad_notification_serving.cc(136)] Maximum ads per hour changed to 5
2021-07-23 06:30:20.960 12950-12950/? V/chromium: [VERBOSE1:ad_notification_serving.cc(169)] Maybe serve ad notification in 0 hours, 12 minutes, 0 seconds at 16:12
2021-07-23 06:45:56.157 12950-12950/? V/chromium: [VERBOSE1:ad_notification_serving.cc(214)] Serving ad notification:
      uuid: 690d7818-f80a-4225-aadb-27b9e6ce0cfb
      creativeInstanceId: 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed
      creativeSetId: 5f8c4787-8431-49a5-9d09-bba40f8ad5f4
      campaignId: d1e25388-b362-4f30-bd4b-36b8205e59e5
      advertiserId: a34de75d-5654-4331-8713-8f4d4e2b6bf7
      segment: untargeted
      title: Vivamus sagittis lacus vel aug
      body: Duis mollis, est non commodo luctus, nisi erat porttitor lig
      targetUrl: https://www.apple.com
2021-07-23 06:45:56.191 12950-12950/? V/chromium: [VERBOSE3:ad_notification_event_served.cc(25)] Served ad notification with uuid 690d7818-f80a-4225-aadb-27b9e6ce0cfb and creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed
2021-07-23 06:45:56.192 12950-12950/? V/chromium: [VERBOSE1:ad_notification_serving.cc(129)] Served ad notification

Confirm the ad notifications per hour is persisted across browser launches

  • Verified ad notification per hour setting is persisted across browser launch
  • Verified ad notifications are shown as per settings

Confirm users are rewarded for seeing new-tab page sponsored images


2021-07-23 07:53:52.707 15149-15149/? V/chromium: [VERBOSE3:new_tab_page_ad_event_served.cc(24)] Served new tab page ad with uuid d4c97b39-cc5d-4e16-8af1-d27f8bc73dd4 and creative instance id 785b3f19-a83a-4a1c-940a-26ecf1c2430c
2021-07-23 07:53:52.709 15149-15149/? V/chromium: [VERBOSE3:new_tab_page_ad_event_viewed.cc(24)] Viewed new tab page ad with uuid d4c97b39-cc5d-4e16-8af1-d27f8bc73dd4 and creative instance id 785b3f19-a83a-4a1c-940a-26ecf1c2430c
2021-07-23 07:53:52.710 15149-15149/? V/chromium: [VERBOSE1:confirmations.cc(90)] Confirming view ad for creative instance id 785b3f19-a83a-4a1c-940a-26ecf1c2430c
2021-07-23 07:53:52.715 15149-15149/? V/chromium: [VERBOSE1:redeem_unblinded_token.cc(50)] Redeem unblinded token
2021-07-23 07:53:52.715 15149-15149/? V/chromium: [VERBOSE1:redeem_unblinded_token.cc(64)] CreateConfirmation
2021-07-23 07:53:52.715 15149-15149/? V/chromium: [VERBOSE2:redeem_unblinded_token.cc(65)] POST /v1/confirmation/{confirmation_id}/{credential}
2021-07-23 07:53:52.716 15149-15149/? V/chromium: [VERBOSE5:redeem_unblinded_token.cc(69)] URL Request:
      URL: https://ads-serve.brave.com/v1/confirmation/9e014478-bcfd-4f47-a7fe-0cedb02ec0a7/eyJwYXlsb2FkIjoie1wiYmxpbmRlZFBheW1lbnRUb2tlblwiOlwieGhRZVhZR21CNm56Yytrb2VZSllqODhSTDVrL0xHRHBSSkxWRURvRFkzRT1cIixcImJ1aWxkQ2hhbm5lbFwiOlwicmVsZWFzZVwiLFwiY291bnRyeUNvZGVcIjpcIlVTXCIsXCJjcmVhdGl2ZUluc3RhbmNlSWRcIjpcIjc4NWIzZjE5LWE4M2EtNGExYy05NDBhLTI2ZWNmMWMyNDMwY1wiLFwicGF5bG9hZFwiOnt9LFwicGxhdGZvcm1cIjpcImFuZHJvaWRcIixcInN0dWRpZXNcIjpbe1wiZ3JvdXBcIjpcIkV4Y2x1ZGVBZElmV2l0aGluVGltZVdpbmRvdz0waFwiLFwibmFtZVwiOlwiQnJhdmVBZHMuRnJlcXVlbmN5Q2FwcGluZ1N0dWR5XCJ9LHtcImdyb3VwXCI6XCJUcmlnZ2Vycz1FTVBUWS9UaHJlc2hvbGQ9MC4wL0lkbGVUaW1lVGhyZXNob2xkPTVcIixcIm5hbWVcIjpcIkJyYXZlQWRzLlVzZXJBY3Rpdml0eVN0dWR5XCJ9XSxcInR5cGVcIjpcInZpZXdcIn0iLCJzaWduYXR1cmUiOiI4aENDRjdsV0VNbGRIWnVlOWVnOUpSU1J3WWxyckZkMm9CTU96UEhsUWkydGxMZTJpRk5oZlplU1RPajVqbG1pOHJBWHIwUWFnRGRWYTRhRlZqZ2lUUT09IiwidCI6Im5wc2M2WTdSWTE3cFJteVk5anlLV3lzMVpjSkt1OElUWVdLOVp4VTlCOG5LSmtBUTUxYWc0RG9GRjdDUDVNMjNjdUo0R0JMNnhjQm1XTmxEdjh3dllBPT0ifQ==
      Content: {"blindedPaymentToken":"xhQeXYGmB6nzc+koeYJYj88RL5k/LGDpRJLVEDoDY3E=","buildChannel":"release","countryCode":"US","creativeInstanceId":"785b3f19-a83a-4a1c-940a-26ecf1c2430c","payload":{},"platform":"android","studies":[{"group":"ExcludeAdIfWithinTimeWindow=0h","name":"BraveAds.FrequencyCappingStudy"},{"group":"Triggers=EMPTY/Threshold=0.0/IdleTimeThreshold=5","name":"BraveAds.UserActivityStudy"}],"type":"view"}
      Content Type: application/json
      Method: POST
2021-07-23 07:53:52.717 15149-15149/? V/chromium: [VERBOSE6:new_tab_page_ad_event_served.cc(32)] Successfully logged new tab page ad served event
2021-07-23 07:53:52.722 15149-15149/? V/chromium: [VERBOSE6:new_tab_page_ad_event_viewed.cc(32)] Successfully logged new tab page ad viewed event

Confirm users see a maximum of 10 ads per hour if ads per hour are set to 10

  • Verified 10 ads are shown per hour at 6 mins gap
2021-07-23 08:46:41.882 17333-17333/? V/chromium: [VERBOSE1:seen_advertisers.h(29)] All ad_notifications have been shown, so round robin
2021-07-23 08:46:41.887 17333-17333/? V/chromium: [VERBOSE1:client.cc(400)] Resetting seen ad_notification advertisers
2021-07-23 08:46:41.888 17333-17333/? V/chromium: [VERBOSE2:exclusion_rule_util.h(26)] creativeSetId 45ea5952-37ca-41f0-88c2-4b546b0e6f4b has exceeded the frequency capping for perDay
2021-07-23 08:46:41.911 17333-17333/? V/chromium: [VERBOSE2:exclusion_rule_util.h(26)] creativeSetId 45ea5952-37ca-41f0-88c2-4b546b0e6f4b has exceeded the frequency capping for perDay
2021-07-23 08:46:41.938 17333-17333/? V/chromium: [VERBOSE2:ad_priority.h(32)] 10 ads with a priority of 1 in bucket 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature/ads OS/Android Fixes related to Android browser functionality OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass - Android ARM QA Pass-macOS QA/Yes release-notes/include
Projects
Archived in project
3 participants