Open omriariav opened 3 months ago
@michaelkleber I found out those wordings here:
Note window.fence here is a new namespace for APIs that are only available from within a fenced frame. In the interim period when FLEDGE supports rendering the winning ad in an iframe, window.fence will also be available in such an iframe.
Potentially, we can fire events (registerAdBeacon()
and registerAdMacro()
) now from the "regular" iframe, right? The only thing is that we need to ensure those events will hold ad cost and bid information.
Will appreciate further guidance. Thank you!
If you are rendering the ad inside a fenced frame or an iframe where the src is the render URL that came out of the PA auction, then you can use the registerAdBeacon()
and registerAdMacro()
functions. (For native ad rendering in that situation, you would presumably use something like postMessage to push some how-to-render information into that frame to make the ad look like you want it to.)
If that doesn't meet your needs — which is to say, if your plan is to pull information out of that iframe, and instead render it somewhere up in the publisher page — then you won't have that reporting system available. In that case you can still reconstruct the association between auctions and their clicks, but it would be more involved:
crypto.randomUUID()
or whatever mechanism you want.registerAdBeacon()
and registerAdMacro()
inside the iframe.With this technique you will end up getting two reports: one with the event ID and the information from the auction, and another with the same event ID and information about the click. Then you will need to do some kind of server-side log join to connect them to each other.
If I were picking between the two techniques, I would probably try the "render inside the iframe" approach. That one is more future-proof when looking ahead to the Fenced Frame era: of course we will need some different way to get the rendering info into the Fenced Frame, but the essential idea should stay the same. But depending on how your various systems work, the log-join approach might be easier to implement for now.
Hi all,
Background: A common model in native advertising is CPC. A native advertising platform charges the advertiser when a user clicks a sponsored content item (ad).
Ad tech platforms engage in different use cases that involve campaign stoppage (avoiding overcharging), billing accountability, bid optimization, bid tuning, campaign pacing, and other related issues (see this case from three years ago—https://github.com/WICG/turtledove/issues/175).
In PAAPI, these use cases will happen in the client upon generating the bid (buyer) and scoring the ad (seller).
To support CPC billing, we need to keep real-time reporting.
What we know: Until the aggregate reporting and fenced frames reporting APIs are enforced in 2026, the following event-level reportings are currently available:
reportWin
- buyer reporting on render (buyer)reportResult
- this is called with the bid that won the auction (seller)renderUrl
rendering in the iframe)According to the explainer,
registerAdBeacon()
andregisterAdMacro()
functions can report the click event within the fenced frame. However, fenced frame does not support native advertising yet, and both of those functions are missing information about the bid and ad cost. There is also ambiguity in the document regarding these functions availability in the current stage of event-level reporting.Challenge: CPC billing is impossible.
There is a race condition between:
reportWin
andreportResult
events with the CPC (these events are reporting thebid
andadCost
values) - fired upon win and render of the ad, and not when the user is clicking the ad. And: The SSP own click reporting event that lacks the CPC billing value as it just comes from the renderUrl within the iframeOpen questions:
bid
field as a representation of the CPM value andadCost
as the representation of billing upon click, viewable impression, an action, or any other event. Can you please confirm this?We're seeking clarity on implementing 'CPC billing' effectively, especially considering the current challenges.
Thank you!