Fence
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheFence interface of theFenced Frame API contains several functions relevant to<fencedframe> functionality.
Fence objects are accessed through theWindow.fence property, but they are only available to documents embedded inside<fencedframe>s (loaded viaFencedFrameConfigs) or<iframe>s (loaded via opaque URNs).
Note:SeeHow do<fencedframe>s work? for some description aroundFencedFrameConfigs and opaque URNs.
In this article
Instance methods
getNestedConfigs()ExperimentalReturns the
FencedFrameConfigs loaded into<fencedframe>s embedded inside the current<fencedframe>.reportEvent()ExperimentalTriggers the submission of report data via abeacon to one ore more specific URLs registered via the
registerAdBeacon()method of theProtected Audience API, for the purpose of collecting ad auction results.setReportEventDataForAutomaticBeacons()ExperimentalSpecifies event data that will be sent when a navigation occurs inside a
<fencedframe>. This data will be sent via an automatic beacon to one or more specific URLs registered via theregisterAdBeacon()method of theProtected Audience API, for the purpose of collecting reporting data for ad auction results.
Examples
window.fence.reportEvent({ eventType: "click", eventData: JSON.stringify({ clickX: "123", clickY: "456" }), destination: ["buyer", "seller"],});Specifications
| Specification |
|---|
| Fenced Frame> # fence-interface> |
Browser compatibility
See also
- Fenced frames on privacysandbox.google.com
- The Privacy Sandbox on privacysandbox.google.com