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

[ads] Rename kViewed and kServed to kViewedImpression and kServedImpression #22807

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Mar 27, 2024

Resolves brave/brave-browser#37132

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • 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 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:

@tmancey tmancey self-assigned this Mar 27, 2024
@tmancey tmancey requested a review from a team as a code owner March 27, 2024 14:49
@tmancey tmancey force-pushed the issues/37132 branch 2 times, most recently from ab8db4a to ad91382 Compare March 27, 2024 16:58
Copy link
Contributor

[puLL-Merge] - brave/brave-core@22807

Here is my review of the PR:

Description

This PR changes terminology and enums related to ad events, mainly replacing "Viewed" and "Served" events with "ViewedImpression" and "ServedImpression". It updates code, comments and documentation across Brave Ads components on Android, iOS and desktop to reflect these changes.

The motivation seems to be clarifying the meaning of these ad events. "Viewed" is changed to "ViewedImpression" likely to make it clearer that it means the ad impression was viewed by the user. Similarly "Served" is changed to "ServedImpression" to clarify it means an ad impression was served.

Changes

Changes

The main changes, organized by area, are:

brave_ads:

  • Updated enums, function names, comments and documentation across the code to change "Viewed" to "ViewedImpression" and "Served" to "ServedImpression"
  • Changed some instances of just "ad" to "ad impression" in comments for clarity
  • Updated markdown docs like README.md with the new terminology

brave_news:

  • Updated calls to Brave Ads to use the new "ViewedImpression" enum value instead of "Viewed"

ntp_background_images:

  • Updated a call to Brave Ads to use "ViewedImpression" enum value

ios:

  • Updated Swift code to use the new "ViewedImpression" and "ServedImpression" enum values
  • Updated some references to firing a "viewed" event to say "viewedImpression"

Security Hotspots

I did not find any major security vulnerabilities in this change. A few notes:

  • The changes are mainly in naming/terminology without altering core logic, which reduces risk
  • Some of the code handles reporting events for ad attribution and serving purposes. While I don't see issues, these are always key areas to review carefully as data needs to be handled properly.
  • The changes span a lot of files, so it will be important to broadly test ad flows to ensure the event name changes didn't introduce any bugs

In summary, while extensive, the changes appear to be mainly cleanliness improvements to ad event naming without major functional changes or security risks. Testing widely, especially ad impression tracking, would still be prudent given the number of files touched. Let me know if you have any other questions!

@tmancey tmancey merged commit 7be13fe into master Mar 28, 2024
19 checks passed
@tmancey tmancey deleted the issues/37132 branch March 28, 2024 13:42
@github-actions github-actions bot added this to the 1.66.x - Nightly milestone Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants