@@ -989,6 +989,16 @@ An attribution report is a [=struct=] with the following items:
989989
990990</dl>
991991
992+ An <dfn>attribution debug info</dfn> is a [=tuple=] with the following items:
993+
994+ <dl dfn-for="attribution debug info">
995+ : <dfn>source debug key</dfn>
996+ :: Null or a [=string=] .
997+ : <dfn>trigger debug key</dfn>
998+ :: Null or a [=string=] .
999+
1000+ </dl>
1001+
9921002<h3 dfn-type=dfn>Event-level report</h3>
9931003
9941004An event-level report is an [=attribution report=] with the following additional items:
@@ -1010,10 +1020,8 @@ An event-level report is an [=attribution report=] with the following additional
10101020:: A string.
10111021: <dfn>attribution destinations</dfn>
10121022:: A [=set=] of [=sites=] .
1013- : <dfn>source debug key</dfn>
1014- :: Null or a non-negative 64-bit integer.
1015- : <dfn>trigger debug key</dfn>
1016- :: Null or a non-negative 64-bit integer.
1023+ : <dfn>attribution debug info</dfn>
1024+ :: An [=attribution debug info=] .
10171025
10181026</dl>
10191027
@@ -1054,10 +1062,8 @@ An <dfn>aggregatable attribution report</dfn> is an [=aggregatable report=] with
10541062:: A [=boolean=] .
10551063: <dfn>trigger context ID</dfn>
10561064:: Null or a [=string=] .
1057- : <dfn>source debug key</dfn>
1058- :: Null or a non-negative 64-bit integer.
1059- : <dfn>trigger debug key</dfn>
1060- :: Null or a non-negative 64-bit integer.
1065+ : <dfn>attribution debug info</dfn>
1066+ :: An [=attribution debug info=] .
10611067
10621068</dl>
10631069
@@ -2181,6 +2187,26 @@ and a [=boolean=] |fenced|:
21812187
21822188Note: The user agent may optionally include error details of any type in |body|["`error`"] .
21832189
2190+ <h3 id="attribution-debug-mode">Attribution debug mode</h3>
2191+
2192+ To <dfn>check if attribution debug mode can be enabled</dfn> given an [=attribution debug info=] |debugInfo|:
2193+
2194+ 1. If |debugInfo|'s [=attribution debug info/source debug key=] is null,
2195+ return false.
2196+ 1. If |debugInfo|'s [=attribution debug info/trigger debug key=] is null,
2197+ return false.
2198+ 1. Return true.
2199+
2200+ To <dfn>serialize an attribution debug info</dfn> given a [=map=] |data| and an
2201+ [=attribution debug info=] |debugInfo|:
2202+
2203+ 1. If |debugInfo|'s [=attribution debug info/source debug key=] is not null, [=map/set=]
2204+ |data|["`source_debug_key`"] to |debugInfo|'s [=attribution debug info/source debug key=] ,
2205+ [=serialize an integer|serialized=] .
2206+ 1. If |debugInfo|'s [=attribution debug info/trigger debug key=] is not null, [=map/set=]
2207+ |data|["`trigger_debug_key`"] to |report|'s [=attribution debug info/trigger debug key=] ,
2208+ [=serialize an integer|serialized=] .
2209+
21842210<h3 id="obtaining-and-delivering-aggregatable-debug-report">Obtaining and delivering an aggregatable debug report</h3>
21852211
21862212To <dfn>check if aggregatable debug reporting should be blocked by rate-limit</dfn>
@@ -2827,7 +2853,7 @@ a [=trigger state=] |triggerState|:
28272853
28282854To <dfn>obtain and deliver a verbose debug report on source registration</dfn> given a
28292855[=source debug data type=] |dataType|, an [=attribution source=] |source|, and
2830- an optional [=boolean=] |isNoised| (default false) :
2856+ a [=boolean=] |isNoised|:
28312857
283228581. If |source|'s [=attribution source/debug reporting enabled=] is false, return.
283328591. If |source|'s [=attribution source/debug cookie set=] is false, return.
@@ -2882,7 +2908,8 @@ an optional [=boolean=] |isNoised| (default false):
28822908 and |source|'s [=attribution source/fenced=] .
28832909
28842910To <dfn>obtain and deliver an aggregatable debug report on source registration</dfn>
2885- given a [=source debug data type=] |dataType| and an [=attribution source=] |source|:
2911+ given a [=source debug data type=] |dataType|, an [=attribution source=] |source|,
2912+ and a [=boolean=] |isNoised|:
28862913
288729141. If |source|'s [=attribution source/fenced=] is true, return.
288829151. Let |config| be |source|'s [=attribution source/aggregatable debug reporting config=] .
@@ -2892,13 +2919,13 @@ given a [=source debug data type=] |dataType| and an [=attribution source=] |sou
289229191. Let |dataTypeToReport| be |dataType|.
289329201. If |dataTypeToReport| is "<code> [=source debug data type/source-success=] </code> "
28942921 and |isNoised| is true, set |dataTypeToReport| to "<code> [=source debug data type/source-noised=] </code> ".
2895- 1. If |debugDataMap|[|dataType |] [=map/exists=] :
2922+ 1. If |debugDataMap|[|dataTypeToReport |] [=map/exists=] :
28962923 1. Let |contribution| be a new [=aggregatable contribution=] with items:
28972924 : [=aggregatable contribution/key=]
2898- :: |debugDataMap|[|dataType |] 's [=aggregatable contribution/key=] bitwise-OR
2925+ :: |debugDataMap|[|dataTypeToReport |] 's [=aggregatable contribution/key=] bitwise-OR
28992926 |config|'s [=aggregatable debug reporting config/key piece=]
29002927 : [=aggregatable contribution/value=]
2901- :: |debugDataMap|[|dataType |] 's [=aggregatable contribution/value=]
2928+ :: |debugDataMap|[|dataTypeToReport |] 's [=aggregatable contribution/value=]
29022929 1. [=list/Append=] |contribution| to |contributions|.
290329301. Run [=obtain and deliver an aggregatable debug report on registration=] with |contributions|,
29042931 |source|'s [=attribution source/source site=], |source|' s [=attribution source/reporting origin=] ,
@@ -2907,12 +2934,13 @@ given a [=source debug data type=] |dataType| and an [=attribution source=] |sou
29072934 and |source|'s [=attribution source/source time=] .
29082935
29092936To <dfn>obtain and deliver debug reports on source registration</dfn>
2910- given a [=source debug data type=] |dataType| and an [=attribution source=] |source|:
2937+ given a [=source debug data type=] |dataType|, an [=attribution source=] |source|,
2938+ and an optional [=boolean=] |isNoised| (default false):
29112939
291229401. Run [=obtain and deliver a verbose debug report on source registration=]
2913- with |dataType| and |source |.
2941+ with |dataType|, |source|, and |isNoised |.
291429421. Run [=obtain and deliver an aggregatable debug report on source registration=]
2915- with |dataType| and |source |.
2943+ with |dataType|, |source|, and |isNoised |.
29162944
29172945To <dfn>process an attribution source</dfn> given an [=attribution source=] |source|:
29182946
@@ -3523,7 +3551,7 @@ and an optional [=attribution report=] <dfn for="obtain verbose debug data on tr
35233551 : [=verbose debug data/data type=]
35243552 :: |dataType|.
35253553 : [=verbose debug data/body=]
3526- :: The result of running [=obtain verbose debug data body on trigger registration=] with |dataType|, |trigger|, |sourceToAttribute| and |report|.
3554+ :: The result of running [=obtain verbose debug data body on trigger registration=] with |dataType|, |trigger|, |sourceToAttribute|, and |report|.
352735551. Return |data|.
35283556
35293557<h3 algorithm id="triggering-event-level-attribution">Triggering event-level attribution</h3>
@@ -3691,8 +3719,8 @@ To <dfn>trigger event-level attribution</dfn> given an [=attribution trigger=] |
369137191. If |matchedConfig|'s [=event-level trigger configuration/dedup key=] is not null,
36923720 [=list/append=] it to |sourceToAttribute|'s [=attribution source/dedup keys=] .
369337211. If |triggeringStatus| is "<code> [=triggering status/attributed=] </code> " and
3694- |report| 's [=event-level report/source debug key=] is not null and |report|' s
3695- [=event-level report/trigger debug key =] is not null , [=queue a task=] to
3722+ the result of [=checking if attribution debug mode can be enabled=]
3723+ with |report|'s [=event-level report/attribution debug info =] is true , [=queue a task=] to
36963724 [=attempt to deliver a debug report=] with |report|.
369737251. Return the [=triggering result=] (|triggeringStatus|, |debugData|).
36983726
@@ -3757,16 +3785,16 @@ To <dfn>trigger aggregatable attribution</dfn> given an [=attribution trigger=]
37573785 with |report| and |sourceToAttribute| is false:
37583786 1. Return the [=triggering result=] ("<code> [=triggering status/dropped=] </code> ",
37593787 ("<code> [=trigger debug data type/trigger-aggregate-insufficient-budget=] </code> ", null)).
3760- 1. Add |report| to the [=aggregatable attribution report cache=] .
3788+ 1. [=set/Append=] |report| to the [=aggregatable attribution report cache=] .
376137891. Increment |sourceToAttribute|'s [=attribution source/number of aggregatable attribution reports=] value by 1.
376237901. Decrement |sourceToAttribute|'s [=attribution source/remaining aggregatable attribution budget=] value by
37633791 |report|'s [=aggregatable attribution report/required aggregatable budget=] .
376437921. If |matchedDedupKey| is not null, [=list/append=] it to |sourceToAttribute|'s [=attribution source/aggregatable dedup keys=] .
376537931. [=set/Append=] |rateLimitRecord| to the [=attribution rate-limit cache=] .
376637941. Run [=generate null attribution reports and assign private state tokens=] with |trigger| and |report|.
3767- 1. If |report| 's [=aggregatable attribution report/source debug key=] is not null and |report|' s
3768- [=aggregatable attribution report/trigger debug key =] is not null, [=queue a task=] to
3769- [=attempt to deliver a debug report=] with |report|.
3795+ 1. If the result of [=checking if attribution debug mode can be enabled=]
3796+ with |report|'s [=aggregatable attribution report/attribution debug info =] is true,
3797+ [=queue a task=] to [= attempt to deliver a debug report=] with |report|.
377037981. Return the [=triggering result=] ("<code> [=triggering status/attributed=] </code> ", null).
37713799
37723800<h3 algorithm id="triggering-attribution">Triggering attribution</h3>
@@ -3960,10 +3988,8 @@ a 64-bit integer priority |priority|, and a [=trigger spec map=] [=map/entry=]
39603988 :: |source|'s [=attribution source/source identifier=] .
39613989 : [=event-level report/report ID=]
39623990 :: The result of [=generating a random UUID=] .
3963- : [=event-level report/source debug key=]
3964- :: |source|'s [=attribution source/debug key=] .
3965- : [=event-level report/trigger debug key=]
3966- :: |triggerDebugKey|.
3991+ : [=event-level report/attribution debug info=]
3992+ :: (|source|'s [=attribution source/debug key=] , |triggerDebugKey|).
396739931. Return |report|.
39683994
39693995<h3 id="obtaining-required-aggregatable-budget">Obtaining an aggregatable report's required budget</h3>
@@ -3990,10 +4016,8 @@ an [=attribution trigger=] |trigger|:
39904016 :: |reportTime|.
39914017 : [=aggregatable attribution report/report ID=]
39924018 :: The result of [=generating a random UUID=] .
3993- : [=aggregatable attribution report/source debug key=]
3994- :: |source|'s [=attribution source/debug key=] .
3995- : [=aggregatable attribution report/trigger debug key=]
3996- :: |trigger|'s [=attribution trigger/debug key=] .
4019+ : [=aggregatable attribution report/attribution debug info=]
4020+ :: (|source|'s [=attribution source/debug key=], |trigger|' s [=attribution trigger/debug key=] ).
39974021 : [=aggregatable attribution report/contributions=]
39984022 :: The result of running [=create aggregatable contributions=] with |source| and |trigger|.
39994023 : [=aggregatable attribution report/serialized private state token=]
@@ -4023,10 +4047,8 @@ To <dfn>obtain a null attribution report</dfn> given an [=attribution trigger=]
40234047 :: |reportTime|
40244048 : [=aggregatable attribution report/report ID=]
40254049 :: The result of [=generating a random UUID=]
4026- : [=aggregatable attribution report/source debug key=]
4027- :: null
4028- : [=aggregatable attribution report/trigger debug key=]
4029- :: |trigger|'s [=attribution trigger/debug key=]
4050+ : [=aggregatable attribution report/attribution debug info=]
4051+ :: (null, |trigger|'s [=attribution trigger/debug key=] )
40304052 : [=aggregatable attribution report/contributions=]
40314053 :: «»
40324054 : [=aggregatable attribution report/serialized private state token=]
@@ -4161,10 +4183,11 @@ of running the following steps:
416141831. If |report| is an:
41624184 <dl class="switch">
41634185 : [=aggregatable attribution report=]
4164- ::
4165- 1. If |report|'s [=aggregatable attribution report/source debug key=] is null, return <strong> disabled</strong> .
4166- 1. If |report|'s [=aggregatable attribution report/trigger debug key=] is null, return <strong> disabled</strong> .
4167- 1. Return <strong> enabled</strong> .
4186+ ::
4187+ 1. If the result of [=checking if attribution debug mode can be enabled=] with
4188+ |report|'s [=aggregatable attribution report/attribution debug info=] is true,
4189+ return <strong> enabled</strong> .
4190+ 1. Return <strong> disabled</strong> .
41684191 : [=aggregatable debug report=]
41694192 :: Return <strong> disabled</strong> .
41704193
@@ -4330,12 +4353,8 @@ To <dfn>obtain an event-level report body</dfn> given an [=attribution report=]
43304353 : "`scheduled_report_time`"
43314354 :: |report|'s [=event-level report/report time=] in seconds since the UNIX epoch, [=serialize an integer|serialized=]
43324355
4333- 1. If |report|'s [=event-level report/source debug key=] is not null, [=map/set=]
4334- |data|["`source_debug_key`"] to |report|'s [=event-level report/source debug key=] ,
4335- [=serialize an integer|serialized=] .
4336- 1. If |report|'s [=event-level report/trigger debug key=] is not null, [=map/set=]
4337- |data|["`trigger_debug_key`"] to |report|'s [=event-level report/trigger debug key=] ,
4338- [=serialize an integer|serialized=] .
4356+ 1. Run [=serialize an attribution debug info=] with |data| and |report|'s
4357+ [=event-level report/attribution debug info=] .
433943581. Return |data|.
43404359
43414360To <dfn>serialize an [=event-level report=]</dfn> |report|, run the following steps:
@@ -4362,12 +4381,8 @@ To <dfn>obtain an [=aggregatable report=] body</dfn> given an [=aggregatable rep
43624381To <dfn>serialize an [=aggregatable attribution report=] </dfn> |report|, run the following steps:
43634382
436443831. Let |data| be the result of running [=obtain an aggregatable report body=] with |report|.
4365- 1. If |report|'s [=aggregatable attribution report/source debug key=] is not null, [=map/set=]
4366- |data|["`source_debug_key`"] to |report|'s [=aggregatable attribution report/source debug key=] ,
4367- [=serialize an integer|serialized=] .
4368- 1. If |report|'s [=aggregatable attribution report/trigger debug key=] is not null, [=map/set=]
4369- |data|["`trigger_debug_key`"] to |report|'s [=aggregatable attribution report/trigger debug key=] ,
4370- [=serialize an integer|serialized=] .
4384+ 1. Run [=serialize an attribution debug info=] with |data| and |report|'s
4385+ [=aggregatable attribution report/attribution debug info=] .
437143861. If |report|'s [=aggregatable attribution report/trigger context ID=] is not null, [=map/set=]
43724387 |data|["`trigger_context_id`"] to |report|'s [=aggregatable attribution report/trigger context ID=] .
437343881. Return the [=byte sequence=] resulting from executing [=serialize an infra value to JSON bytes=] on |data|.
@@ -4844,7 +4859,7 @@ it requires browsing activity on multiple sites.
48444859
48454860The [=aggregatable debug reports=] may also encode non-Same-Origin data but in
48464861encrypted form. The security risk is further mitigated by the generation of
4847- null debug reports and the additive noise addition in the aggregation service.
4862+ null debug reports and the additive noise in the aggregation service.
48484863
48494864## Opting in to the API ## {#opting-in-to-the-api}
48504865
0 commit comments