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

Add NTP search promo P3A question #14189

Merged
merged 2 commits into from
Jul 27, 2022
Merged

Add NTP search promo P3A question #14189

merged 2 commits into from
Jul 27, 2022

Conversation

DJAndries
Copy link
Collaborator

@DJAndries DJAndries commented Jul 14, 2022

Resolves brave/brave-browser#24065

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:

Regression testing of brave/brave-browser#23191 recommended.

  1. Launch browser using --enable-features="BraveSearchNTP" switch, with fresh profile.
  2. Access brave://local-state, ensure Brave.Search.Promo.NewTabPage does not exist.
  3. Access brave://settings/search, change search engine to something other than Brave.
  4. Ensure sponsored images are disabled and access new tab page, ensure promo appears.
  5. Check local state, the metric should now exist, and should be set to 0.
  6. Make search query via NTP promo.
  7. Metric should have a value of 1.
  8. Change the default search engine to Brave by either clicking on the prompt that appears on the search engine results page, or via brave://settings/search (may be good to test both).
  9. Relevant metric should have a value of 3.
  10. Start over with a fresh profile, see promo but do not perform a search.
  11. Change search engine to Brave via one of the methods in step 8. (Accessing https://search.brave.com/search?q=test&action=makeDefault directly will force the SERP prompt to show up.)
  12. Relevant metric should have a value of 2.

@DJAndries DJAndries requested review from rillian and simonhong July 14, 2022 18:57
@DJAndries DJAndries requested a review from iefremov as a code owner July 14, 2022 18:57
@DJAndries DJAndries force-pushed the search-promo-ntp-p3a branch from 4d87138 to 9c58091 Compare July 14, 2022 18:57
@@ -83,6 +86,10 @@ void BraveNewTabPageHandler::InitForSearchPromotion() {
base::Unretained(this)));
template_url_service_observation_.Observe(
TemplateURLServiceFactory::GetForProfile(profile_));

brave_search_conversion::p3a::RecordPromoShown(
Copy link
Member

Choose a reason for hiding this comment

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

This is called whenever NTP is created if promotion is enabled.
However, NTP will not show promotion when sponsored images are displayed.
When sponsored images are displayed, this should not be called.
I'll push another commit.

Copy link
Member

Choose a reason for hiding this comment

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

Pushed 0e00a36

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.

++ first commit :)

@simonhong
Copy link
Member

Kindly ping @iefremov :)

@DJAndries DJAndries merged commit 272f410 into master Jul 27, 2022
@DJAndries DJAndries deleted the search-promo-ntp-p3a branch July 27, 2022 22:36
@github-actions github-actions bot added this to the 1.44.x - Nightly milestone Jul 27, 2022
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.

Add NTP search promo P3A question
4 participants