Demo: Attribution Reporting API

Demo version: v-2023-05-02

Ask questions / Share feedback 👋

Is there a feature you'd like to see added to this demo? Do you have any questions, requests, or issues running the demo?
We want to hear from you. Open an issue on our dev support repo and select the type Attribution Reporting (or ask your question on the developer mailing list).

See the code

Code for this demo. You can reuse and customize it.

Set up your browser

⚠️ Make sure to follow these instructions.

Browser requirements

Setup (may require browser restart)

Run the demo

In this demo an advertiser uses an adtech provider to run their ads on a publisher site. Follow the flow below to see how the API generates event-level and aggregatable reports:

  1. First visit the publisher site and view and/or click an ad on that site.
      Because this ad is configured with special attribution parameters, a source event is registered. You'll see that either anchor elements or JavaScript calls can be used to generate a source event.
  2. Second, either follow the link for a clickable ad or visit the advertiser site directly (direct visits will *not* trigger a conversion)
  3. 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).
  4. 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

Next Steps

Now that you've learned how event-level reports and aggregatable reports are generated, learn how to collect and process aggregatable reports with the aggregation service.