# Cross App and Web Attribution Measurement ## Authors: * Charlie Harrison * Michael Thiessen * John Delaney ## Participate See [Participate](https://github.com/WICG/conversion-measurement-api#participate). Please file [GitHub issues](https://github.com/WICG/conversion-measurement-api/issues?q=is%3Aissue+is%3Aopen+label%3Aapp-to-web+) with the `app-to-web` label. ## Introduction Currently, the [Attribution Reporting API](https://github.com/WICG/conversion-measurement-api) supports attributing events within a single browser instance. This proposal expands the scope of attribution to allow attributing conversions that happen on the web to events that happen off the browser, within other applications. This proposal was inspired by Safari's [App-to-web support in Private Click Measurement](https://webkit.org/blog/11529/introducing-private-click-measurement-pcm/#:~:text=App-to-Web) and the [Android Privacy Sandbox](https://developer.android.com/design-for-safety/privacy-sandbox/attribution) proposal. The proposal here takes advantage of OS-level support for attribution. In particular, it gives the developer an option to allow events on the mobile web to be joinable with events in [Android’s Privacy Sandbox](https://developer.android.com/design-for-safety/privacy-sandbox/attribution), although support for other platforms could also be implemented. ## Goals * Support measurement of ads that show up within apps that later convert on the web * Support measurement of ads that show up within the browser that later convert on the web or in an app / app install * Support both clicks and views * Proposal is generic enough to be implemented by any browser * While focusing initially on Android support, the proposal should be generic enough to be supported on other platforms ## API changes ```mermaid sequenceDiagram participant B as Browser participant O as OS platform participant R as Reporting endpoint Note over B,R: For either source or trigger registration B->>R: Registration request advertising OS support R->>B: Response headers chooses how registration is handled alt header opts into OS handling B->>O: Passes relevant information to the OS O->>R: OS re-pings to attain full registration config else header opts out and provides browser registration B->>B: Applies standard registration end ``` See Android's [Attribution reporting: cross app and web measurement proposal](https://developer.android.com/design-for-safety/privacy-sandbox/attribution-app-to-web) for one example of an OS API that a browser can integrate with to do cross app and web measurement. The existing API involves sending requests to the reporting origin to register events. These requests will have a new request header `Attribution-Reporting-Eligible`. On requests with this header, the browser will additionally broadcast possible web or OS-level support for attribution to the reporting origin's server via a new [dictionary structured request header](https://httpwg.org/specs/rfc8941.html#dictionary): ``` Attribution-Reporting-Support: os, web ``` Note that if there is neither web nor OS-level support for attribution, no background requests will be made and the browser will not set `Attribution-Reporting-Eligible` header on ``, `window.open`, ``, or `