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

Trigger user gesture events on browser initiated navigations. #17490

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

aseren
Copy link
Collaborator

@aseren aseren commented Mar 6, 2023

Add triggering of user gesture events on browser-initiated navigations because some browser-initiated navigations have HasUserGesture set to false (crbug.com/617904).
Resolves brave/brave-browser#28826

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 wiki
    • npm run lint, npm run presubmit wiki, 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:

  • Do a search request from the omnibox on Android
  • Check that a user activity event was triggered

@aseren aseren requested a review from a team as a code owner March 6, 2023 17:31
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

@btlechowski
Copy link

Verification passed on Brave v1.51.30 on Lenovo TB-8506FS (Android 11.0)

Verified searching for test through omnibox increases user activity score (/*12*/ kTypedAndSelectedNonUrl)

20:54:19.306  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 12 (0.5:2:900 s)
20:54:20.786  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 0D (0.5:2:900 s)

Verified opening a page through omnibox increases user activity score /*14*/ kTypedUrl

21:15:51.273  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 15 (0:2:900 s)
21:15:51.273  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 14 (0.5:2:900 s)
21:15:51.390  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 11 (0.5:2:900 s)

Verified clicking on a link on a page increases user activity score /*06*/ kClickedLink

21:18:43.310  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 06 (2:2:900 s)

Verified ad was shown when threshold was reached

21:18:59.940  V  [VERBOSE6:user_activity_manager.cc(49)] Triggered event: 11 (3:2:900 s)
21:20:01.812  V  [VERBOSE1:eligible_notification_ads_v1.cc(38)] Get eligible notification ads:
21:20:01.822  V  [VERBOSE1:eligible_notification_ads_v1.cc(96)] Get eligible ads for child segments:
21:20:01.823  V  [VERBOSE1:eligible_notification_ads_v1.cc(98)]   technology & computing-technology & computing
21:20:01.823  V  [VERBOSE1:eligible_notification_ads_v1.cc(98)]   hobbies & interests-genealogy
21:20:01.823  V  [VERBOSE1:eligible_notification_ads_v1.cc(98)]   education-education
21:20:01.828  V  [VERBOSE1:eligible_notification_ads_v1.cc(127)] No eligible ads out of 0 ads for child segments
21:20:01.829  V  [VERBOSE1:eligible_notification_ads_v1.cc(151)] Get eligible ads for parent segments:
21:20:01.829  V  [VERBOSE1:eligible_notification_ads_v1.cc(153)]   technology & computing
21:20:01.830  V  [VERBOSE1:eligible_notification_ads_v1.cc(153)]   hobbies & interests
21:20:01.830  V  [VERBOSE1:eligible_notification_ads_v1.cc(153)]   education
21:20:01.834  V  [VERBOSE1:eligible_notification_ads_v1.cc(180)] No eligible ads out of 0 ads for parent segments
21:20:01.834  V  [VERBOSE1:eligible_notification_ads_v1.cc(196)] Get eligible ads for untargeted segment
21:20:01.851  V  [VERBOSE3:priority.h(30)] 11 ads with a priority of 1 in bucket 1
21:20:01.851  V  [VERBOSE1:eligible_notification_ads_v1.cc(229)] 11 eligible ads out of 11 ads for untargeted segment
21:20:01.852  V  [VERBOSE1:notification_ad.cc(135)] Opportunity arose to serve a notification ad
21:20:01.853  V  [VERBOSE1:notification_ad_serving.cc(131)] Found 11 eligible ads
21:20:01.854  V  [VERBOSE1:notification_ad_serving.cc(196)] Served notification ad:
                   placementId: c5997097-30ab-42c5-ab83-921ab3072408
                   creativeInstanceId: d55f52f6-f02b-4808-b6e2-b2a7734ad836
                   creativeSetId: 45ea5952-37ca-41f0-88c2-4b546b0e6f4b
                   campaignId: 1c1ac828-db13-49bb-9128-090132044b7f
                   advertiserId: ecbcc833-8b1d-4867-98f7-ad2341396ce8
                   segment: untargeted
                   title: Ad2
                   body: Ad2
                   targetUrl: https://brave.com/
21:20:01.885  V  [VERBOSE3:notification_ad_event_served.cc(19)] Served notification ad with placement id c5997097-30ab-42c5-ab83-921ab3072408 and creative instance id d55f52f6-f02b-4808-b6e2-b2a7734ad836
21:20:01.957  V  [VERBOSE1:notification_ad_serving.cc(158)] Maybe serve notification ad in 0 hours, 12 minutes, 0 seconds at 21:32:01.888
21:20:01.957  V  [VERBOSE3:notification_ad_event_viewed.cc(19)] Viewed notification ad with placement id c5997097-30ab-42c5-ab83-921ab3072408 and creative instance id d55f52f6-f02b-4808-b6e2-b2a7734ad836
21:20:01.958  V  [VERBOSE1:notification_ad_event_served.cc(28)] Successfully logged notification ad served event
21:20:01.969  V  [VERBOSE6:notification_ad_event_viewed.cc(28)] Successfully logged notification ad viewed event
21:20:01.992  V  [VERBOSE3:account.cc(202)] Successfully processed deposit for ad_notification with creative instance id d55f52f6-f02b-4808-b6e2-b2a7734ad836 and view valued at 0.01

kjozwiak pushed a commit that referenced this pull request Mar 14, 2023
kjozwiak pushed a commit that referenced this pull request Mar 14, 2023
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.

Searching or opening pages through omnibox does not trigger events for user activity
3 participants