demo · v130

Registration header builder

Construct an Attribution-Reporting-Register-Source response with the new scope fields. Validate against the per-source limits in the spec — 20 effective scopes max, 50 characters per source scope, scope_limit and max_event_states bounded — then preview single-scope, multi-scope, and omitted-scope trigger matching.

Source registration controls

attribution_scopes

Source scope values are strings. The current spec checks type, the 50-character maximum, effective-set size, and limit; it does not define a character whitelist.

trigger preview

Comma-separated list. Leave blank to omit the field, which keeps all sources eligible.

scope capacity

0 / 20

validation

    Attribution-Reporting-Register-Source

    
          
    
          

    Rejected header sample

    
          
    
          

    trigger match (simulated)

    
        

    the code

    // Server-side response when registering a source impression
    res.setHeader("Attribution-Reporting-Register-Source", JSON.stringify({
      source_event_id: "42-summer-launch",
      destination: "https://shop.example",
      attribution_scopes: { limit: 5, values: ["campaign-summer", "campaign-fall"], max_event_states: 3 }
    }));
    
    // Trigger registration accepts a list and matches by set intersection:
    // { "attribution_scopes": ["campaign-summer", "brand-loyalty"] }
    // → source eligible because "campaign-summer" overlaps.
    
    // If the trigger omits attribution_scopes, all sources remain eligible.

    see also