Skip to content

Commit fc135ae

Browse files
committed
Invoke measure conversion from fetch
1 parent f71f63a commit fc135ae

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

api.bs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,14 @@ The <dfn method for=Attribution>measureConversion(|options|)</dfn> method steps
15281528

15291529
1. Let |implicitInputs| be the result of [=obtaining the implicit API inputs=] from [=this=].
15301530
1. [=Assert=]: |implicitInputs| is not null.
1531+
1. Return the result of running [=measure a conversion=] with |options| and |implicitInputs|.
1532+
1533+
</div>
1534+
1535+
<div algorithm>
1536+
To <dfn>measure a conversion</dfn> given {{AttributionConversionOptions}} |options|
1537+
and [=implicit API inputs=] |implicitInputs|:
1538+
15311539
1. Let |document| be |implicitInputs|'s [=implicit API inputs/associated document=].
15321540
1. Let |realm| be |document|'s [=relevant realm=].
15331541
1. If |document| is not [=allowed to use=] the [=policy-controlled feature=] named
@@ -2232,13 +2240,27 @@ and [=response=] |response|, run these steps:
22322240

22332241
1. Let |saveImpressionHeader| be the result of [=header list/get|getting=] <code>[:Save-Impression:]</code> from |response|'s [=response/header list=].
22342242

2235-
1. If |saveImpressionHeader| is null, return.
2243+
1. If |saveImpressionHeader| is not null:
2244+
2245+
1. Let |impressionOptions| be the result of [=parse a Save-Impression header|parsing=] |saveImpressionHeader|.
2246+
2247+
1. If |impressionOptions| is not an error, [=save an impression|Save=] |impressionOptions| with |implicitInputs|.
2248+
2249+
1. Let |measureConversionHeader| be the result of [=header list/get|getting=] <code>[:Measure-Conversion:]</code> from |response|'s [=response/header list=].
2250+
2251+
1. If |measureConversionHeader| is not null:
2252+
2253+
1. Let |parseConversionResult| be the result of [=parse a Measure-Conversion header|parsing=] |measureConversionHeader|.
2254+
2255+
1. If |parseConversionResult| is not an error:
2256+
2257+
1. Let (|conversionOptions|, |reportUrl|) be |parseConversionResult|.
22362258

2237-
1. Let |impressionOptions| be the result of [=parse a Save-Impression header|parsing=] |saveImpressionHeader|.
2259+
1. Let |reportPromise| be the result of running [=measure a conversion=] with |conversionOptions| and |implicitInputs|.
22382260

2239-
1. If |impressionOptions| is an error, return.
2261+
1. [=In parallel=], [=upon fulfillment=] of |reportPromise|, [=send a report=] with its value and |reportUrl|.
22402262

2241-
1. [=save an impression|Save=] |impressionOptions| with |implicitInputs|.
2263+
Issue: Confirm the desired semantics of [:Save-Impression:] and [:Measure-Conversion:] in the same response.
22422264

22432265
</div>
22442266

0 commit comments

Comments
 (0)