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

New tab page sponsored image (NTP SI) P3A metrics for users not opted in to rewards #24609

Closed
DJAndries opened this issue Aug 11, 2022 · 9 comments · Fixed by brave/brave-core#14595

Comments

@DJAndries
Copy link
Collaborator

DJAndries commented Aug 11, 2022

P3A metrics will be dynamically created for each NTP-SI campaign. Views, clicks and landings will be recorded for each campaign.

The name format will be as follows: creativeInstanceId.{campaign id}.{event type}.

These metrics will be reported daily, for up to seven days per campaign. When the metrics are uploaded, the header X-Brave-P3A-Creative will be set to true.

This issue depends on #24318 and #24319 .

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Oct 31, 2022

Verification PASSED on

Brave | 1.46.81 Chromium: 107.0.5304.68 (Official Build) beta (64-bit)
-- | --
Revision | a4e93e89d3b3df1be22214603fba846ad0183ca5-refs/branch-heads/5304@{#991}
OS | Windows 10 Version 21H2 (Build 19044.2130)
Verify creativeInstanceId when ads rewards is disabled_PASSED
  • Confirmed that creativeInstanceId doesn't exists in brave://local-state when ads and rewards is disabled
    image
Verify creative metric with the suffix views_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
Example Example
image image
Verify creative metric with the suffix clicks_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI)
  • Confirmed that one creative metric with the suffix clicks exists in the local state page
Example Example Example
image image image
Verify creative metrics are sent to the endpoint https://p3a-creative.brave.com_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI) and stay on the landing page for 10 secs
  • Confirmed that one creative metric with the suffix clicks and lands exists in the local state page
Example Example Example
image image image
  • Close the browser
  • Set the sys date ahead by one day
  • Open charles proxy
  • Relaunch the browser and ensured creative metrics are sent to the endpoint https://p3a-creative.brave.com
View Click Land
image image (1) image (2)
  • Open brave://local-state file and ensured creative metrics are NOT shown in local-state file
    image

  • Close browser, advance the time by one day, open browser, ensure the metrics are not resent.

brave://local-state https://p3a-creative.brave.com
image image

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 2, 2022

@DJAndries I would need a clarification on step 4 and 5. In the step 4, I have adavanced the sys clock by one day (i.e 3rd Nov) when I relaunch the browser, I don't see creativeInstanceId in the brave://local-state file, Is that expected? Also, I could see the header P3A-creative.brave.com listed in the charles proxy network monitoring tool as below. In this case how do we know the metrics are sent with the flag true? the step 5 also behaves same as step 4. What is the difference between the step 4 and step 5?
image (16)

image (15)

@DJAndries
Copy link
Collaborator Author

@GeetaSarvadnya Once the metric has been sent, you should not see the creativeInstanceId-prefixed metric on the local state page (unless you viewed/clicked/landed on the same ad between the time the value was recorded by the P3A system and the time the metric was sent). The header is no longer relevant, only the URL https://p3a-creative.brave.com. I updated the test plan accordingly. In step 5, you should ensure that the metric sent in step 4 is not resent, unless you viewed/clicked/landed on the same ad again.

@GeetaSarvadnya
Copy link

Removing the QA Pass label as this issue will be uplifted to 1.45 via brave/brave-core#15745 and testing will be done in 1.45.x

@kjozwiak
Copy link
Member

kjozwiak commented Nov 4, 2022

The above requires 1.45.121 or higher for 1.45.x verification 👍

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 7, 2022

Verification PASSED on

Brave | 1.45.121 Chromium: 107.0.5304.91 (Official Build) (64-bit)
-- | --
Revision | 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097}
OS | Windows 10 Version 21H2 (Build 19044.2130)
Verify creativeInstanceId when ads rewards is disabled_PASSED
  • Confirmed that creativeInstanceId doesn't exists in brave://local-state when ads and rewards is disabled
    image
Verify creative metric with the suffix views_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
Example Example
image image
Verify creative metric with the suffix clicks_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI)
  • Confirmed that one creative metric with the suffix clicks exists in the local state page
Example Example Example
image image image
Verify creative metrics are sent to the endpoint https://p3a-creative.brave.com_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI) and stay on the landing page for 10 secs
  • Confirmed that one creative metric with the suffix clicks and lands exists in the local state page
Example Example Example
image image image
  • Close the browser
  • Set the sys date ahead by one day
  • Open charles proxy
  • Relaunch the browser and ensured creative metrics are sent to the endpoint https://p3a-creative.brave.com
View Click Land
image image image
  • Open brave://local-state file and ensured creative metrics are NOT shown in local-state file

image

  • Close browser, advance the time by one day, open browser, ensure the metrics are not resent.
brave://local-state https://p3a-creative.brave.com
image image

@GeetaSarvadnya
Copy link

@DJAndries I don't see landed creativeinstanceId in brave://local-state even which I click on NTP SI and stay on the landing page for more than 10 secs. This was working fine when I tested the issue in 1.46.81. what could be the reason, any idea?

@GeetaSarvadnya
Copy link

Landed creativeinstanceId's are shown now, thanks @DJAndries !

@kjozwiak kjozwiak removed this from the 1.45.x - Release #6 milestone Nov 8, 2022
@kjozwiak kjozwiak added this to the 1.45.x - Release #7 milestone Nov 8, 2022
@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 9, 2022

Verification PASSED on Samsung Galaxy Tab A7 version 12 running Bravemonoarm64.apk_1.45.121

Verify creativeInstanceId when ads rewards is disabled_PASSED
  • Confirmed that creativeInstanceId doesn't exists in brave://local-state when ads and rewards is disabled
    Screenshot_20221109-172908_Brave
Verify creative metric with the suffix views_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
Example Example
Screenshot_20221109-173215_Brave Screenshot_20221109-173041_Brave
Verify creative metric with the suffix clicks_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI)
  • Confirmed that one creative metric with the suffix clicks exists in the local state page
Example Example Example
Screenshot_20221109-173215_Brave Screenshot_20221109-173153_Brave Screenshot_20221109-173105_Brave
Verify creative metrics are sent to the endpoint https://p3a-creative.brave.com_PASSED
  • Clean profile 1.46.x
  • Open brave://local-state file
  • Open NTP until NTP SI is shown
  • Reload the brave://local-state file
  • Confirmed that one creative metric with the suffix views exists in the local state page
  • Click on the creative (NTP SI) and stay on the landing page for 10 secs
  • Confirmed that one creative metric with the suffix clicks and lands exists in the local state page
Example Example Example
Screenshot_20221109-173215_Brave Screenshot_20221109-173153_Brave Screenshot_20221109-173731_Brave
  • Close the browser
  • Set the sys date ahead by one day
  • Open charles proxy
  • Relaunch the browser and ensured creative metrics are sent to the endpoint https://p3a-creative.brave.com
View Click Land
image image image
  • Open brave://local-state file and ensured creative metrics are NOT shown in local-state file
    Screenshot_20221110-182348_Brave

  • Close browser, advance the time by one day, open browser, ensure the metrics are not resent.

brave://local-state https://p3a-creative.brave.com
Screenshot_20221111-182714_Brave image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment