Skip to content

Try trigger NTPSI ad on each NTP refresh. #14225

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

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Try trigger NTPSI ad on each NTP refresh. #14225

merged 1 commit into from
Jul 21, 2022

Conversation

aseren
Copy link
Collaborator

@aseren aseren commented Jul 19, 2022

We should trigger NTPSI ad on each refresh except cases:

  • Brave Private Ads are disabled
  • Previously prefetched NTPSI ad is not consumed

Resolves brave/brave-browser#24107

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Need to check that if there is no prefetched NTP ad, then each NTP refresh/open triggers NTP ad serving attempt.

@aseren aseren requested a review from a team as a code owner July 19, 2022 11:19
@aseren aseren requested a review from simonhong July 19, 2022 11:19
@aseren aseren force-pushed the issues/24107 branch 2 times, most recently from 67195c8 to b8da1af Compare July 19, 2022 12:58
Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM++

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ with one comment for f/u

@aseren aseren force-pushed the issues/24107 branch 3 times, most recently from aba4707 to 6f50cc1 Compare July 20, 2022 17:35
@aseren aseren merged commit 363491f into master Jul 21, 2022
@aseren aseren deleted the issues/24107 branch July 21, 2022 09:15
@github-actions github-actions bot added this to the 1.43.x - Nightly milestone Jul 21, 2022
@btlechowski
Copy link

Verification passed on

Brave 1.43.45 Chromium: 104.0.5112.57 (Official Build) nightly (64-bit)
Revision 212fd173a0da1e0a024f328295bb56a2529190bb-refs/branch-heads/5112@{#1042}
OS Ubuntu 18.04 LTS

ads enabled

Verified attempt to serve the ad is made every NTP load
Verified when ad is served (prefetched) no longer
Verified ad is shown (view event) on 2nd, 6th, 10th etc NTP load

1st NTP - ad is served (prefetched):

[3864:3864:0725/204912.367854:VERBOSE1:eligible_new_tab_page_ads_v1.cc(161)] Get eligible ads for untargeted segment
[3864:3864:0725/204912.378338:VERBOSE2:priority.h(34)] 3 ads with a priority of 1 in bucket 1
[3864:3864:0725/204912.378463:VERBOSE1:new_tab_page_ad.cc(61)] Opportunity arose to serve a new tab page ad
[3864:3864:0725/204912.378541:VERBOSE1:new_tab_page_ad_serving.cc(89)] Found 3 eligible ads
[3864:3864:0725/204912.378622:VERBOSE1:new_tab_page_ad_serving.cc(138)] Served new tab page ad:
  placementId: 2c75ee3e-6519-43f5-ac48-cccc0238cdb4
  creativeInstanceId: a9eff08f-a6a8-4e1c-ae12-771a29fe497f
  creativeSetId: 891b1fde-9fb6-483e-8f67-9018eb10b46d
  campaignId: 854aad5a-1640-41e1-acbb-350bb9c32c40
  advertiserId: 19923db9-23f4-4362-b8d1-76b401883cb8
  segment: untargeted
  companyName: Solana
  imageUrl: https://mobile-data.s3.brave.com/assets/ntp-si/cc48d69c-d313-4f2d-9d82-17c4108f9d35.png
  alt: Online Hackathon $5 million in global prizes & seed funding.
  targetUrl: https://solana.com/summercamp
  wallpaper:
    imageUrl: https://mobile-data.s3.brave.com/assets/ntp-si/997c250e-99a2-4ceb-bb6e-4699cb989111.jpeg
    focalPoint:
      x: 1280
      y: 720
[3864:3864:0725/204912.384210:VERBOSE3:new_tab_page_ad_event_served.cc(23)] Served new tab page ad with placement id 2c75ee3e-6519-43f5-ac48-cccc0238cdb4 and creative instance id a9eff08f-a6a8-4e1c-ae12-771a29fe497f
[3864:3864:0725/204912.418705:VERBOSE6:new_tab_page_ad_event_served.cc(31)] Successfully logged new tab page ad served event

2nd NTP - ad is viewed (shown):

[3864:3864:0725/204918.402052:VERBOSE3:new_tab_page_ad_event_viewed.cc(23)] Viewed new tab page ad with placement id 2c75ee3e-6519-43f5-ac48-cccc0238cdb4 and creative instance id a9eff08f-a6a8-4e1c-ae12-771a29fe497f
[3864:3864:0725/204918.444657:VERBOSE6:new_tab_page_ad_event_viewed.cc(31)] Successfully logged new tab page ad viewed event
[3864:3864:0725/204918.459589:VERBOSE3:account.cc(164)] Successfully processed deposit for new_tab_page_ad with creative instance id a9eff08f-a6a8-4e1c-ae12-771a29fe497f and view valued at 0.01

3rd NTP - attempt to serve the ad is made but blocked due frequency capping

[3864:3864:0725/204918.829324:VERBOSE2:permission_rule_util.cc(25)] New tab page ad cannot be shown as minimum wait time has not passed
[3864:3864:0725/204918.829441:VERBOSE1:new_tab_page_ad_serving.cc(66)] New tab page ad not served: Not allowed due to permission rules

4th NTP - attempt to serve the ad is made but blocked due frequency capping

[3864:3864:0725/204930.108127:VERBOSE2:permission_rule_util.cc(25)] New tab page ad cannot be shown as minimum wait time has not passed
[3864:3864:0725/204930.108329:VERBOSE1:new_tab_page_ad_serving.cc(66)] New tab page ad not served: Not allowed due to permission rules

5th NTP - attempt to serve the ad is made but blocked due frequency capping

[3864:3864:0725/204931.648234:VERBOSE2:permission_rule_util.cc(25)] New tab page ad cannot be shown as minimum wait time has not passed
[3864:3864:0725/204931.648444:VERBOSE1:new_tab_page_ad_serving.cc(66)] New tab page ad not served: Not allowed due to permission rules

6th NTP - ad is served

[3864:3864:0725/205725.738891:VERBOSE1:eligible_new_tab_page_ads_v1.cc(38)] Get eligible new tab page ads:
[3864:3864:0725/205725.748482:VERBOSE1:eligible_new_tab_page_ads_v1.cc(161)] Get eligible ads for untargeted segment
[3864:3864:0725/205725.752154:VERBOSE2:exclusion_rules_base.cc(127)] creativeInstanceId a9eff08f-a6a8-4e1c-ae12-771a29fe497f has exceeded the perHour frequency cap
[3864:3864:0725/205725.752399:VERBOSE1:seen_advertisers.h(30)] All new_tab_page_ad advertisers have been shown, so round robin
[3864:3864:0725/205725.752595:VERBOSE1:client_state_manager.cc(461)] Resetting seen new_tab_page_ad advertisers
[3864:3864:0725/205725.756719:VERBOSE2:priority.h(34)] 2 ads with a priority of 1 in bucket 1
[3864:3864:0725/205725.756890:VERBOSE1:new_tab_page_ad.cc(61)] Opportunity arose to serve a new tab page ad
[3864:3864:0725/205725.757001:VERBOSE1:new_tab_page_ad_serving.cc(89)] Found 2 eligible ads
[3864:3864:0725/205725.757129:VERBOSE1:new_tab_page_ad_serving.cc(138)] Served new tab page ad:
  placementId: 97ce16a8-e51d-49c9-b377-d0142de197dd
  creativeInstanceId: 156ba7e2-6b7f-4715-8942-57b502cad006
  creativeSetId: 891b1fde-9fb6-483e-8f67-9018eb10b46d
  campaignId: 854aad5a-1640-41e1-acbb-350bb9c32c40
  advertiserId: 19923db9-23f4-4362-b8d1-76b401883cb8
  segment: untargeted
  companyName: Solana
  imageUrl: https://mobile-data.s3.brave.com/assets/ntp-si/e793a45e-e9b8-43d1-aa9e-7171c992bad3.png
  alt: Online Hackathon $5 million in global prizes & seed funding.
  targetUrl: https://solana.com/summercamp
  wallpaper:
    imageUrl: https://mobile-data.s3.brave.com/assets/ntp-si/d6035a41-9597-4d54-8f93-f4417cf94082.jpeg
    focalPoint:
      x: 1280
      y: 720
[3864:3864:0725/205725.764480:VERBOSE3:new_tab_page_ad_event_served.cc(23)] Served new tab page ad with placement id 97ce16a8-e51d-49c9-b377-d0142de197dd and creative instance id 156ba7e2-6b7f-4715-8942-57b502cad006
[3864:3864:0725/205725.796057:VERBOSE6:new_tab_page_ad_event_served.cc(31)] Successfully logged new tab page ad served event

7th, 8th, 9th - ad is already served so we do nothing

10th and is shown

[3864:3864:0725/205853.349174:VERBOSE3:new_tab_page_ad_event_viewed.cc(23)] Viewed new tab page ad with placement id 97ce16a8-e51d-49c9-b377-d0142de197dd and creative instance id 156ba7e2-6b7f-4715-8942-57b502cad006
[3864:3864:0725/205853.404725:VERBOSE2:permission_rule_util.cc(25)] New tab page ad cannot be shown as minimum wait time has not passed
[3864:3864:0725/205853.404829:VERBOSE1:new_tab_page_ad_serving.cc(66)] New tab page ad not served: Not allowed due to permission rules
[3864:3864:0725/205853.410483:VERBOSE6:new_tab_page_ad_event_viewed.cc(31)] Successfully logged new tab page ad viewed event
[3864:3864:0725/205853.416828:VERBOSE3:account.cc(164)] Successfully processed deposit for new_tab_page_ad with creative instance id 156ba7e2-6b7f-4715-8942-57b502cad006 and view valued at 0.01
[3864:3864:0725/205853.417303:VERBOSE1:confirmations.cc(61)] Confirming view for new_tab_page_ad with transaction id 5b548064-d9e0-4211-b968-aa4b839f60d1 and creative instance id 156ba7e2-6b7f-4715-8942-57b502cad006

ads disabled

Verified ads are shown but user is not paid

1st ad not shown
2nd ad shown
3rd ad not shown
4th ad not shown
5th ad not shown
6th ad shown
7th ad not shown
8th ad not shown
9th ad not shown
10th ad shown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to trigger NTP SI on each NTP refresh
4 participants