files/en-us/web/api/fence/index.md
{{SeeCompatTable}}{{APIRef("Fenced Frame API")}}
The Fence interface of the {{domxref("Fenced Frame API", "Fenced Frame API", "", "nocode")}} contains several functions relevant to {{htmlelement("fencedframe")}} functionality.
Fence objects are accessed through the {{domxref("Window.fence")}} property, but they are only available to documents embedded inside {{htmlelement("fencedframe")}}s (loaded via {{domxref("FencedFrameConfig")}}s) or {{htmlelement("iframe")}}s (loaded via opaque URNs).
[!NOTE] See How do
<fencedframe>s work? for some description aroundFencedFrameConfigs and opaque URNs.
{{InheritanceDiagram}}
<fencedframe>s embedded inside the current <fencedframe>.<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.window.fence.reportEvent({
eventType: "click",
eventData: JSON.stringify({ clickX: "123", clickY: "456" }),
destination: ["buyer", "seller"],
});
{{Specifications}}
{{Compat}}