Skip to content

Commit

Permalink
Update API namespaces (WICG#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivanigithub authored Mar 18, 2022
1 parent c19b0ad commit 01e9d15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Fenced_Frames_Ads_Reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ Browser will process this similar to how the existing [navigator.sendBeacon](htt


```
navigator.reportEvent({
window.fence.reportEvent({
'eventType': 'click',
'eventData': {'clickX': '123', 'clickY': '456'},
'destination':['buyer', 'seller']
});
```

Note `window.fence` here is a new namepsace for APIs that are only available from within a fenced frame.

## registerAdBeacon

A similar API was initially discussed here: https://github.com/WICG/turtledove/issues/99 for reporting clicks. The idea is that the buyer and seller side worklets are able to register a URL with the browser in their reportWin and reportResult APIs. A beacon will be sent to the registered URL when events are reported by the fenced frame via reportEvent.
Expand All @@ -85,7 +87,7 @@ The worklet is able to add the buyerEventId/sellerEventId and any other relevant


```
navigator.registerAdBeacon({
registerAdBeacon({
'click': {'url': 'https://adtech.example/click?buyer_event_id=123'},
});
```
Expand Down

0 comments on commit 01e9d15

Please sign in to comment.