Demo: Attribution Reporting API
Demo version: v-2022-04-29
Ask questions / Share feedback 👋
See the code Code for this demo. You can reuse and customize it.
Set up your browser
⚠️ Make sure to follow these steps.
- Use the latest Chrome Beta, Canary or Dev.
- Don't use Incognito or Guest mode, because the API is disabled on these profiles.
- Don't block third-party cookies.
- Deactivate ad-blocking extensions on the pages where you need to test the API (or create a fresh user profile without extensions). Ad-blocking browser extensions may block some of the API's functionality if script names contain the term "ad".
Setup (may require browser restart)
- Ensure the Privacy Sandbox APIs are enabled at chrome://settings/privacySandbox.
- Enable the flag chrome://flags/#privacy-sandbox-ads-apis (will require restart).
Run the demo
In this demo an advertiser uses an adtech provider to run their ads on a publisher sites. Follow the flow below to see how the API generates event-level and aggregatable reports:
- First visit the publisher site and view and/or click an ad on that site.
- Second, either follow the link for a clickable ad or visit the advertiser site directly (direct visits will *not* trigger a conversion)
- Third, interact with the product on the advertiser site by visiting the product page, adding the product to your cart, or making a purchase...
While interacting with the product, the adtech endpoint will be informed. It decides that your actions are conversions, and hence will trigger attributions, with variable trigger data values, for your engagements on the advertiser's site.
After attributions have been triggered, attribution reports are generated and stored in local storage in your browser (on your device).
- Finally, open chrome://attribution-internals to inspect the reports that have been generated.
The reports are configured to be sent to the adtech provider setup in Step 1