Attribution-Reporting-Register-Trigger header
Deprecated: This feature is no longer recommended. While some browsers might still support it, it may have already been removed from the relevant web standards, could be in the process of being dropped, or might only be retained for compatibility. Avoid using it and update any existing code if possible; see the compatibility table at the bottom of this page to guide your decision. This feature may cease to work at any time.
The HTTP Attribution-Reporting-Register-Trigger response header registers a page feature as an attribution trigger. This header is included in a response to a request that contains the Attribution-Reporting-Eligible header. See the Attribution Reporting API for more details.
Note: If the calling site has not successfully completed the privacy sandbox enrollment process to include the Attribution Reporting API, the Attribution-Reporting-Register-Trigger header is ignored and attribution triggers are not registered.
| Header type | Response header |
|---|---|
| CORS-safelisted response header | No |
Syntax
Attribution-Reporting-Register-Trigger: <json-string>
Directives
This header contains a JSON object, which is an array of up to three objects. Each object represents the current user’s selected topics for the last three epochs and includes the following properties:
<json-string>
A JSON string containing data for generated reports, such as the trigger’s ID, priority, and deduplication values. The available fields are:
"aggregatable_trigger_data"
An array of objects, where each object defines an aggregation key to be applied to different source keys. Each object has the following properties:
"key_piece"
A hexadecimal value that represents a key.
"source_keys"
An array that holds one or more key values for the data.
"aggregatable_values"
An object containing properties where each property represents a value for a data point defined in "aggregatable_trigger_data". The property name matches a name defined in "source_keys", and its value can be any arbitrary value you need.
"debug_key" Optional
A numerical debug key. Set this to generate a debug report in addition to the associated attribution report.
"debug_reporting" Optional
A boolean value. If a debug_key is present, set this to true to indicate that the generated debug report should be verbose.
"filters" Optional
An object that contains custom data used to filter which triggers generate reports. See Filters for more details.
"event_trigger_data"
An object containing data about the trigger. The available sub-fields are:
"trigger_data"
A string that describes the trigger, often used to denote events like “user added item to shopping cart” or “user signed up to mailing list”. This value will be included in any generated event-level report, though it may be altered based on the attributed source’s "trigger_data_matching" field.
Note: The values used for each event and the number of elements in the array are entirely arbitrary and set by the developer. The array may include unused values, but values must be present for the browser to attribute them to the source when a trigger is registered.
"priority" Optional
A string representing a priority value for the attribution trigger. By default, triggers are linked to the most recently matched source. For both event-level and summary reports, assigning a higher priority number allows the trigger to match older sources. For example, a value of 2 will override the default value of 1. See Report priorities and limits for more information.
"deduplication_key" Optional
A string representing a unique key to prevent duplicate attributions, such as when a user adds the same item to a shopping cart multiple times. See Prevent duplication in reports for more information.
"filters" Optional
An object containing filters that apply selective filtering to set "trigger_data", "priority", and "deduplication_key". This filtering is based on the filter_data defined in a corresponding Attribution-Reporting-Register-Source header. See Filters for more information.
Examples
Registering a trigger for an event-level report
A Node.js server might set the Attribution-Reporting-Register-Trigger response header as follows to register a trigger intended to match an event-level report attribution source:```js
res.set(
“Attribution-Reporting-Register-Trigger”,
JSON.stringify({
event_trigger_data: [
{
trigger_data: “4”,
priority: “1000000000000”,
deduplication_key: “2345698765”,
},
],
debug_key: “1115698977”,
}),
);
### Registering a trigger for a summary report
When registering a trigger intended to match with a summary report attribution source, you need to include the following fields:```js
res.set(
"Attribution-Reporting-Register-Trigger",
JSON.stringify({
aggregatable_trigger_data: [
{
key_piece: "0x400",
source_keys: ["campaignCounts"],
},
{
key_piece: "0xA80",
source_keys: ["geoValue", "nonMatchingKeyIdsAreIgnored"],
},
],
aggregatable_values: {
campaignCounts: 32768,
geoValue: 1664,
},
debug_key: "1115698977",
}),
);
How to Modify Header using Requestly
Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Attribution-Reporting-Register-Trigger header. This is useful when you want to test conversion measurement flows and validate how your site handles attribution triggers during development or debugging. Steps to Modify the Attribution-Reporting-Register-Trigger Header:
- Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
- Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
- Add a new header modification:
- Under “Action”, select “Add” or “Override”.
- In the “Header Name” field, enter Attribution-Reporting-Register-Trigger.
- In the “Header Value” field, enter your trigger configuration as a JSON string (for example, { “event_trigger_data”: […] }).
- Set the URL condition: Specify the URL or pattern where this header should apply (for example, https://your-website.com/\*).
- Save the rule.
Once configured, Requestly will inject the Attribution-Reporting-Register-Trigger header into all matching responses. This allows you to simulate conversion triggers and verify that attribution reporting works correctly.
You might need to modify the Attribution-Reporting-Register-Trigger header to test ad campaign conversions, validate reporting logic, or debug Privacy Sandbox attribution flows without changing your production server configuration. This helps ensure your measurement setup works correctly before goin
Set headers visually: intercept and modify HTTP headers without touching your code using Requestly.
Download Free →