Event-level reports for single touch attribution
- Overview
- Scope
- Demo
Overview
Description
Event-level reports help measure ad effectiveness while protecting user privacy. This demo shows how the Attribution Reporting API links ad
interactions to conversions without revealing user identities across websites. It focuses on single-touch attribution using the last-click model.
Privacy Sandbox APIs
Related parties
- Publisher: Hosts ads
- Advertiser: Hosts conversion pages, tracks conversions
- Ad Tech: Implements API, receives cross-site reports
Scope
System Design
We are exploring two distinct user journeys for ad attribution:
- User Journey 1: Click-through conversion: The user visits a news site, clicks on an ad, then navigates to the advertiser's site where they convert. The system tracks the ad click and the subsequent conversion.
- User Journey 2: View-through conversion: The user sees an ad on a news site without clicking it. Later, they independently visit the advertiser's site and convert. The system connects this conversion to the earlier ad view. In both cases, the Attribution Reporting API links the ad interaction (click or view) to a conversion without compromising user privacy across sites.
Attribution Reporting (Event-level) Flow
We focus on two user journeys: click-through and view-through conversions. In the click-through journey, the user actively clicks an ad on a
publisher's site before converting on the advertiser's site. In the view-through journey, on the other hand, the user sees an ad without clicking, and
later independently visits and converts on the advertiser's site. Both journeys enable advertisers to measure ad effectiveness by linking ad
interactions (clicks or views) to conversions, all while preserving user privacy across different websites.
The following sequence diagram illustrates these two main user journeys in digital advertising attribution: click-through and view-through. It shows how the Attribution Reporting API tracks user interactions across publisher and advertiser websites, highlighting the key differences in timing and user behavior between the two scenarios.
Demo
Prerequisites
- Chrome > v127 (Open chrome://version to look up your current version)
- Open chrome://attribution-internals/ and Click on “Clear all attribution data”
Click-Through Conversion Journey
- Clear attribution data in chrome://attribution-internals/
- Navigate to news site
- ice skate shoes image will be displayed
- Click on the ad image
- Demo shop site of skate shoes detail page will open
- Check “SourceTrigger Registration” tab in chrome://attribution-internals
- Go back to the shop site and click the "ADD TO CART" button
- Review “Trigger Registration” and "Event-Level Reports" tab in chrome://attribution-internals
View-Through Conversion Journey
- Clear attribution data in chrome://attribution-internals/
- Navigate to news site
- ice skate shoes image will be displayed
- Click on "To the shop without ad click" below the image
- Demo shop site will open
- Check “SourceTrigger Registration” tab in chrome://attribution-internals
- Go back to the shop site and click an item
- Click on the "ADD TO CART" button
- Review “Trigger Registration” and "Event-Level Reports" tab in chrome://attribution-internals
Implementation details
Register a source
Sources are registered when a user views or clicks an ad. This is done on the publisher's website.
To do so we need to:
- Initiate the source registration with an HTML element or a Javascript call
- Complete the source registration, responding to the request with the header Attribution-Reporting-Register-Source.
Initiatie the source registration
For views:
<img id="adImg" alt="ad image" loading="lazy"
onclick="adClick()"
attributionsrc="https://privacy-sandbox-demos-dsp.dev/attribution/register-source?advertiser=privacy-sandbox-demos-shop.dev&id=u26f8"
src="https://privacy-sandbox-demos-shop.dev/image/svg/emoji_u26f8.svg" />
*Here's the source code
For clicks:
function adClick() {
const encoded = encodeURIComponent("https://privacy-sandbox-demos-dsp.dev/attribution/register-source?advertiser=privacy-sandbox-demos-shop.dev&id=u26f8");
const url = "https://privacy-sandbox-demos-shop.dev/items/26f8";
window.open(
url,
"_blank",
`attributionsrc=${encoded}`);
}
*Here's the source code
Complete the source registration
For both clicks and views is to respond with the Attribution-Reporting-Register-Source header.
res.set(
"Attribution-Reporting-Register-Source",
JSON.stringify({
destination: "https://privacy-sandbox-demos-shop.dev";
source_event_id: "1234",
expiry: "604800",
priority: "100",
debug_key: "1234",
debug_reporting: true,
})
);
*Here's the source code
Register a trigger
Triggers are registered when a user converts on the advertiser's website. Here we will use a pixel.
Initiate the trigger registration
<button onclick="addToCart()" type="submit"...>ADD TO CART</button>
function addToCart() {
const attributionReporting = {
eventSourceEligible: false,
triggerEligible: true,
};
const url = "https://privacy-sandbox-demos-dsp.dev/attribution/register-event-level-trigger?conversion-type=add-to-cart"
window.fetch(url, {
mode: "no-cors", keepalive: true, attributionReporting
});
}
*Here's the source code
Respond with a header
Here, we set Attribution-Reporting-Register-Trigger on the request:
res.set(
"Attribution-Reporting-Register-Trigger",
JSON.stringify({
event_trigger_data: [{
trigger_data: "6",
priority: "80",
}],
debug_reporting: true,
debug_key: "1115698977"
});
);
*Here's the source code
Set up an endpoint
All we have to do now is to create an endpoint at https://adtech.example/.well-known/attribution-reporting/report-event-attribution
to receive
reports.