files/en-us/web/api/fence/setreporteventdataforautomaticbeacons/index.md
{{SeeCompatTable}}{{APIRef("Fenced Frame API")}}
The setReportEventDataForAutomaticBeacons() method of the
{{domxref("Fence")}} interface specifies event data that will be sent when a navigation occurs inside a {{htmlelement("fencedframe")}}. This data will be sent via an automatic beacon to one or more specific URLs registered via the {{domxref("InterestGroupReportingScriptRunnerGlobalScope.registerAdBeacon", "registerAdBeacon()")}} method of the Protected Audience API, for the purpose of collecting reporting data for ad auction results.
[!NOTE] {{domxref("Fence.reportEvent", "reportEvent()")}} provides similar report data submission, except in that case the submission is triggered via an explicit method call rather than a navigation.
setReportEventDataForAutomaticBeacons(event)
event
eventType
reserved.top_navigation_start: An event fired when a top-level navigation begins.reserved.top_navigation_commit: An event fired when a top-level navigation completes.eventData
destination
"buyer": The bidder in the ad auction."seller": The top-level seller running the ad auction."component-seller": The seller for a component auction in a multi-level auction."direct-seller": The seller that directly ran the auction the buyer bid in. If the ad was a single-level auction, the value used will be "seller". If the ad was a multi-level auction, the value used will be "component-seller"."shared-storage-select-url": A Shared Storage API storage location, as defined in a {{domxref("WindowSharedStorage.selectURL", "Window.sharedStorage.selectURL()")}} method call.once {{optional_inline}}
true, the automatic beacon will only be sent for the next event, and beacons will not be sent for subsequent events until setReportEventDataForAutomaticBeacons() is invoked again. For example, when used with a click handler this can be used to send beacon data only for specific top-level navigations, rather than for every top-level navigation. This property defaults to false.None (Undefined).
window.fence.setReportEventDataForAutomaticBeacons({
eventType: "reserved.top_navigation_start",
eventData: "an example string",
destination: ["seller", "buyer"],
});
{{Specifications}}
{{Compat}}