docs.rodeo

MDN Web Docs mirror

Attribution-Reporting-Register-Trigger

{{HTTPSidebar}} {{seecompattable}} 

The HTTP Attribution-Reporting-Register-Trigger {{Glossary("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 {{HTTPHeader("Attribution-Reporting-Eligible")}}  header.

See the Attribution Reporting API for more details.

[!NOTE] If the calling site does not have the Attribution Reporting API included in a successful privacy sandbox enrollment process, the Attribution-Reporting-Register-Trigger header is ignored and attribution triggers are not registered.

Header type `{{Glossary("Response header")}}` 
`{{Glossary("Forbidden request header")}}`  No
`{{Glossary("CORS-safelisted response header")}}`  No

Syntax

Attribution-Reporting-Register-Trigger: <json-string>

Directives

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:

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:

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",
  }),
);

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN