From e3f537db722a7ed0d427e2d39ff87d1e629fe0cb Mon Sep 17 00:00:00 2001 From: John Delaney <40465606+johnivdel@users.noreply.github.com> Date: Mon, 23 May 2022 14:23:24 -0400 Subject: [PATCH] Make the attributionsrc ping optional Resolves https://github.com/WICG/conversion-measurement-api/issues/378 --- EVENT.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/EVENT.md b/EVENT.md index 10fd8b454..91b55adcc 100644 --- a/EVENT.md +++ b/EVENT.md @@ -109,6 +109,12 @@ Protocol](https://github.com/brave/brave-browser/wiki/Security-and-privacy-model Attribution sources are events which future triggers can be attributed to. There are two types of attribution sources, `navigation` sources and `event` sources. +Sources are registered by returning a new HTTP response header on requests which +eligible for attribution. A request is eligible as long as it has the +`Attribution-Reporting-Eligible` request header. + + + `navigation` sources are registered via clicks on anchor tags: ```html `, ``, and `window.open` mechanisms will cause the browser to -initiate a `keepalive` fetch request to the URL indicated by `attributionsrc`. +Specifying a URL value for `attributionsrc` within ``, ``, or `window.open` +will cause the browser to initiate a `keepalive` fetch request that is eligible for +attribution. + +When the `attributionsrc` attribute is present in these surfaces/APIs, both with and +without a value, existing requests made via `src`, `href`, or `window.open` will +include the `Attribution-Reporting-Eligible` request header. Each of these +requests will be able to register attribution sources. -Response headers will be processed for any request that includes the -`Attribution-Reporting-Eligible` request header, not just ones initiated via -`window.fetch`. For example, responses will also be processed for -`XmlHttpRequest` if the header was present on the corresponding request. +Other requests APIs which allow specifying header, such as `XmlHttpRequest`, are +able to use this as well. -The response to this request will configure the API. The browser will expect +The response to these requests will configure the API. The browser will expect data in a new JSON HTTP header `Attribution-Reporting-Register-Source` which configures the API: