-
Notifications
You must be signed in to change notification settings - Fork 871
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] Only collect, store and redeem essential metadata #24188
Conversation
48d24e6
to
5a47d09
Compare
Privacy review https://github.com/brave/reviews/issues/1636 |
7b8edc3
to
a058925
Compare
c68c858
to
618ee9d
Compare
@ShivanKaul how about linking this page to https://github.com/brave/brave-core/blob/issues/38955/components/brave_ads/core/internal/account/confirmations/non_reward/README.md? This way, we can avoid the need to keep both pages in sync. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of my review comments have been addressed.
| creativeInstanceId | {"creativeInstanceId":"e4958d00-e35c-4134-a408-1fbcf274d5ae"} | An id that references the specific ad creative that the user engaged with. This will be the same for any user that engages with this ad. | | ||
| transactionId | {"transactionId":"c14d370c-1178-4c73-8385-1cfa17200646"} | A unique id for the transaction, which is not linkable between confirmation redemptions. | | ||
| type | {"type":"click"} | Action or interaction that occurred within an advertisement, such as a user clicking the ad.<br><br>Supported types:<br><br>Brave Search ads:<br>- conversion<br><br>Brave News ads:<br>- view<br>- click<br>- landed<br>- conversion | | ||
| user data | {"conversion":[{"action":"click"}]} | See [user data](../../user_data/README.md#non-brave-rewards-user). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| user data | {"conversion":[{"action":"click"}]} | See [user data](../../user_data/README.md#non-brave-rewards-user). | | |
| user_data | {"conversion":[{"action":"click"}]} | For non-Rewards users, this is minimal. See [user data](../../user_data/README.md#non-brave-rewards-user). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding user_data
see #24188 (comment). Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding "For non-Rewards users, this is minimal," this is not true for Brave News users because they can opt in without joining Brave Rewards.
| transactionId | {"transactionId":"c14d370c-1178-4c73-8385-1cfa17200646"} | A unique id for the transaction, which is not linkable between confirmation token redemptions. | | ||
| type | {"type":"view"} | Action or interaction that occurred within an advertisement, such as a user clicking the ad.<br><br>Supported types:<br><br>- view<br>- click<br>- landed<br>- conversion<br>- media_play[^1]<br>- media_25[^1]<br>- media_100[^1]<br>- upvote<br>- downvote<br>- flag<br>- bookmark | | ||
| confirmation token | {"blindedPaymentTokens": ["Ev5JE4/9TZI/5TqyN9JWfJ1To0HBwQw2rWeAPcdjX3Q="],<br> "publicKey": "RJ2i/o/pZkrH+i0aGEMY1G9FXtd7Q7gfRi3YdNRnDDk="} | See [security and privacy model for ad confirmations](https://github.com/brave/brave-browser/wiki/Security-and-privacy-model-for-ad-confirmations). | | ||
| user data | {"buildChannel":"nightly",<br>"catalog":[{"id":"29e5c8bc0ba319069980bb390d8e8f9b58c05a20"}],<br>"conversion":[{"action":"view"}],<br>"createdAtTimestamp":"2020-11-18T12:00:00.000Z",<br>"httpResponseStatus":"errorPage",<br>"platform":"windows",<br>"rotatingHash":"I6KM54gXOrWqRHyrD518LmhePLHpIk4KSgCKOl0e3sc=",<br>"segment":"sports",<br>"studies":[{"group":"GroupA","name":"BraveAds.FooStudy"},{"group":"GroupB","name":"BraveAds.BarStudy"}],<br>"versionNumber":"1.2.3.4"} | See [user data](../../user_data/README.md#brave-rewards-users). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| user data | {"buildChannel":"nightly",<br>"catalog":[{"id":"29e5c8bc0ba319069980bb390d8e8f9b58c05a20"}],<br>"conversion":[{"action":"view"}],<br>"createdAtTimestamp":"2020-11-18T12:00:00.000Z",<br>"httpResponseStatus":"errorPage",<br>"platform":"windows",<br>"rotatingHash":"I6KM54gXOrWqRHyrD518LmhePLHpIk4KSgCKOl0e3sc=",<br>"segment":"sports",<br>"studies":[{"group":"GroupA","name":"BraveAds.FooStudy"},{"group":"GroupB","name":"BraveAds.BarStudy"}],<br>"versionNumber":"1.2.3.4"} | See [user data](../../user_data/README.md#brave-rewards-users). | | |
| user_data | {"buildChannel":"nightly",<br>"catalog":[{"id":"29e5c8bc0ba319069980bb390d8e8f9b58c05a20"}],<br>"conversion":[{"action":"view"}],<br>"createdAtTimestamp":"2020-11-18T12:00:00.000Z",<br>"httpResponseStatus":"errorPage",<br>"platform":"windows",<br>"rotatingHash":"I6KM54gXOrWqRHyrD518LmhePLHpIk4KSgCKOl0e3sc=",<br>"segment":"sports",<br>"studies":[{"group":"GroupA","name":"BraveAds.FooStudy"},{"group":"GroupB","name":"BraveAds.BarStudy"}],<br>"versionNumber":"1.2.3.4"} | See [user data](../../user_data/README.md#brave-rewards-users). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShivanKaul, in this context, user data is not a key that is sent to the server, which is why it was written as user data without the underscore. However, I’m happy to change it if you think it would make things clearer. Thanks
Is |
This would not be the final link. We need to replace issues/38955 with master which will only work once this is merged. Thanks |
@fmarier I decoupled |
592b050
to
905f9f5
Compare
components/brave_ads/core/internal/account/user_data/fixed/page_land_user_data.cc
Outdated
Show resolved
Hide resolved
components/brave_ads/core/internal/user_engagement/conversions/conversions_util_internal.cc
Outdated
Show resolved
Hide resolved
Co-authored-by: Francois Marier <francois@brave.com>
…ption payload for Rewards users
Co-authored-by: Francois Marier <francois@brave.com>
[puLL-Merge] - brave/brave-core@24188 DescriptionThis PR makes significant changes to the Brave Ads codebase, focusing on handling ad conversions and events for both Brave Rewards users and non-Rewards users. The changes aim to improve the handling of different ad types, conversion tracking, and event triggering based on user settings and ad types. Possible Issues
Security Hotspots
ChangesChanges
Overall, this PR represents a significant refactoring of the ad handling and conversion tracking system in Brave Ads, with a focus on improving support for non-Rewards users while maintaining functionality for Rewards users. |
Resolves brave/brave-browser#38955
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Also, see brave/brave-browser#38955.
Non-Brave Rewards user:
Test Case #1:
Fresh install
Navigate to search.brave.software
Search for
giraffe
EXPECT RESULT: Ad viewed event should not occur
Navigate to https://www.brave.com/vertical-tabs/ to trigger a conversion
EXPECT RESULT: View-through conversion should not occur
The following state should be verified:
Default/ads_service/client.json
state should be emptyDefault/ads_service/confirmations.json
state should be emptyDefault/ads_service/database.sqlite
:--
Test Case #2:
Fresh install
Navigate to search.brave.software
Search for
giraffe
Click
[Staging] Brave Ads
adEXPECT RESULT:
Clicked search result ad with placement id # and creative instance id #
andSuccessfully saved creative set conversions
appear in the console logNavigate to https://www.brave.com/vertical-tabs/ to trigger a conversion
EXPECT RESULT:
Successfully processed conversion confirmation for search_result_ad with transaction id # and creative instance id #
appears in the console log and{"conversion":[{"action":"click"}],"creativeInstanceId":"#","transactionId":"#","type":"conversion"}
should be sent tohttps://search.anonymous.ads.bravesoftware.com/v3/confirmation/#
The following state should be verified:
Default/ads_service/client.json
state should be emptyDefault/ads_service/confirmations.json
state should be emptyDefault/ads_service/database.sqlite
:creative_set_conversions
table should contain a list of conversions for the associated creative setad_events
table should only contain click and conversion events--
Test Case #3:
Brave Rewards user:
Test Case #1: