Attribution reporting
The attributionSrc property of the HTMLAnchorElement interface gets and sets the attributionsrc attribute on an <a> element programmatically, reflecting the value of that attribute. attributionsrc specifies that you want the browser to send an Attribution-Reporting-Eligible header. On the server-side this is used to trigger sending an Attribution-Reporting-Register-Source header in the response, to register of a navigation-based attribution source.
The browser stores the source data associated with the navigation-based attribution source (as provided in the Attribution-Reporting-Register-Source response header) when it receives the navigation response.
See the Attribution Reporting API for more details.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
attributionSrc Deprecated | 125 | 125 | | | 125 | |
| HTML attribute | ||||||
attributionsrc Deprecated | 125 | 125 | | | 125 | |
attributionsrc Deprecated | 125 | 125 | | | 125 | |
allow (attribution-reporting) Deprecated | 117 | 117 | | | 117 | |
attributionsrc Deprecated | 125 | 125 | | | 125 | |
attributionsrc Deprecated | 125 | 125 | | | 125 | |
| DOM API | ||||||
init_attributionReporting_parameter Deprecated `init.attributionReporting` parameter | 125 | 125 | | | 125 | |
attributionSrc Deprecated | 133 | 133 | | | 133 | |
attributionSrc Deprecated The attributionSrc property of the HTMLImageElement interface that you want the browser to send an Attribution-Reporting-Eligible header along with the image request. It reflects the element's attributionsrc content attribute. | 125 | 125 | | | 125 | |
attributionSrc Deprecated The attributionSrc property of the HTMLScriptElement interface gets and sets the attributionsrc attribute on a script element programmatically, reflecting the value of that attribute. attributionsrc specifies that you want the browser to send an Attribution-Reporting-Eligible header along with the script resource request. | 125 | 125 | | | 125 | |
Request (init attributionReporting parameter) Deprecated `init.attributionReporting` parameter | 125 | 125 | | | 125 | |
open (features parameter attributionsrc) Deprecated `features` parameter accepts `"attributionsrc"` value | 125 | 125 | | | 125 | |
setAttributionReporting Deprecated The setAttributionReporting() method of the XMLHttpRequest interface indicates that you want the request's response to be able to register a JavaScript-based attribution source or attribution trigger. | 125 | 125 | | | 125 | |
| Other | ||||||
Attribution-Reporting-Eligible Deprecated The HTTP Attribution-Reporting-Eligible request header indicates that the corresponding response is eligible to register an attribution source or trigger. | 117 | 117 | | | 117 | |
Attribution-Reporting-Register-Source Deprecated The HTTP Attribution-Reporting-Register-Source response header registers a page feature as an attribution source. This header is included as part of a response to a request that contains the Attribution-Reporting-Eligible header. It provides the information that the browser should store when a user interacts with the attribution source. The information you… | 117 | 117 | | | 117 | |
Attribution-Reporting-Register-Trigger Deprecated The HTTP Attribution-Reporting-Register-Trigger response header registers a page feature as an attribution trigger. This header is included as part of a response to a request that contains the Attribution-Reporting-Eligible header. | 117 | 117 | | | 117 | |
Attribution-Reporting-Support Deprecated | 117 | 117 | | | 117 | |
attribution-reporting Deprecated The HTTP Permissions-Policy header attribution-reporting directive controls whether the current document is allowed to use the Attribution Reporting API. | 117 | 117 | | | 117 | |
Syntax
<a href="https://shop.example.com"
attributionsrc="https://adtech.example.com/register">
Advertisement link
</a>
<img src="ad.png"
attributionsrc="https://adtech.example.com/register"> Use cases
-
Use Attribution reporting
Use Attribution reporting when standard HTML needs a more specific platform feature, semantic signal, or browser capability.
-
Handle edge cases
Apply Attribution reporting to solve a focused requirement without redesigning the whole page architecture.
Cautions
- Test Attribution reporting in your target browsers and input environments before depending on it as a primary behavior.
- Provide a fallback path or acceptable degradation strategy when support is still limited.
Accessibility
- Make sure Attribution reporting supports the intended task without making the page harder to perceive, understand, or operate.