diff --git a/spec.bs b/spec.bs
index 65aa289..aeb6dab 100644
--- a/spec.bs
+++ b/spec.bs
@@ -1875,13 +1875,13 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
1. If [=this=]'s [=relevant settings object=]'s [=environment settings object/origin=] and
|instance|'s [=fenced frame config instance/mapped url=]'s [=url/origin=] are not [=same
- origin=], then return.
+ origin=], and if |event|'s {{FenceEvent/crossOriginExposed}} is false, then return.
1. If |instance|'s [=fenced frame config instance/fenced frame reporter=] is null, then return.
1. Set [=this=]'s [=relevant global object=]'s [=associated Document=]'s [=Document/automatic
- beacon data map=][|event|'s {{FenceEvent/eventType}}] to an [=fencedframetype/automatic beacon
- data=] with the following [=struct/items=]:
+ beacon data mapping=][|event|'s {{FenceEvent/eventType}}] to an [=fencedframetype/automatic
+ beacon data=] with the following [=struct/items=]:
: [=automatic beacon data/eventData=]
:: |event|'s {{FenceEvent/eventData}} if defined and |instance|'s [=fenced frame config
@@ -2239,22 +2239,26 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate
instance/is ad component=] is false, and |sourceSnapshotParams|'s [=source snapshot
params/initiator ancestor root referrer policy=] otherwise.
- 1. Let |beacon data| be |sourceSnapshotParams|'s [=source snapshot params/automatic beacon data
- map=][|eventType|].
+ 1. Let |isCrossOrigin| be true if |sourceOrigin| is not [=same origin=] with |config|'s [=fenced
+ frame config instance/mapped url=]'s [=url/origin=], false otherwise.
+
+ 1. Let |beaconMapping| be |sourceSnapshotParams|'s [=source snapshot params/snapshot automatic
+ beacon store=]'s [=snapshot automatic beacon store/data mapping=] if |isCrossOrigin| is false,
+ |sourceSnapshotParams|'s [=source snapshot params/snapshot automatic beacon store=]'s
+ [=snapshot automatic beacon store/cross-origin exposed data mapping=] otherwise.
- 1. Let |has header opt in| be |sourceSnapshotParams|'s [=source snapshot params/automatic beacons
- allowed=].
+ 1. Let |beaconData| be |beaconMapping|[|eventType|].
- 1. If |beacon data| is null and |has header opt in| is false, abort these steps.
+ 1. Let |automaticBeaconsAllowed| be |sourceSnapshotParams|'s [=source snapshot params/automatic
+ beacons allowed=].
- 1. Let |is cross origin| be true if |sourceOrigin| is not [=same origin=] with |config|'s [=fenced
- frame config instance/mapped url=]'s [=url/origin=], false otherwise.
+ Note: This tracks whether there was an opt-in via the [:Allow-Fenced-Frame-Automatic-Beacons:]
+ header. Automatic beacons can still be sent out while this value is false for either
+ same-origin documents or documents that opt-in via setting data.
- 1. If |is cross origin| is true and |has header opt in| is false, abort these steps.
+ 1. If |beaconData| is null and |automaticBeaconsAllowed| is false, abort these steps.
- 1. Let |should send beacon with data| be true if |beacon data| is not null and either
- |is cross origin| is false or |beacon data|'s [=automatic beacon data/crossOriginExposed=] is
- true, false otherwise.
+ 1. If |isCrossOrigin| is true and |automaticBeaconsAllowed| is false, abort these steps.
1. [=list/For each=] |destination| of |config|'s [=fenced frame config instance/fenced frame
reporter=]'s [=fenced frame reporter/fenced frame reporting metadata reference=]'s
@@ -2268,10 +2272,8 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate
:: |eventType|
: [=automatic beacon event/data=]
- :: |beacon data|'s [=automatic beacon data/eventData=] if |should send beacon with data| is
- true, |beacon data|'s [=automatic beacon data/destinations=] [=list/contains=]
- |destination|, and |config|'s [=fenced frame config instance/is ad component=] is false,
- the empty string otherwise.
+ :: The empty string if |beaconData| is null, |beaconData|'s [=automatic beacon
+ data/eventData=] otherwise.
: [=automatic beacon event/attributionReportingEnabled=]
:: |sourceSnapshotParams|'s [=source snapshot params/attribution reporting enabled=]
@@ -2279,8 +2281,8 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate
: [=automatic beacon event/attributionReportingContextOrigin=]
:: |sourceSnapshotParams|'s [=source snapshot params/attribution reporting context origin=]
- 1. If |beacon data|'s [=automatic beacon data/once=] is true, set |sourceSnapshotParams|'s
- [=source snapshot params/automatic beacon data map=][|eventType|] to null.
+ 1. If |beaconData|'s [=automatic beacon data/once=] is true, set |beaconMapping|[|eventType|] to
+ null.