prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Proposed tracking update

Open YuriyVelichkoPI opened this issue 11 months ago • 2 comments

Background

The Mobile Committee is actively working on reducing discrepancies in impression tracking. There are several POC approaches, and one of them assumes that impression URLs (burl, imp .. any other one from the bid response) will be tracked by Prebid SDK code.

In short - the Prebid SDK will track the viewability of Google's Ad View and track an impression event(s) once the ad view is on the screen.

Objectves

However, If SDK tracks the impression - the PUC should not fire burl and Prebid's win event .

From our current perspective, the most efficient way to disable tracking of burl by PUC without any AdOps work is to extract respective fields from the OpenRTB before caching it. In this case, PUC just won't have pixels to track.

If there is any other approach that won't affect the current publisher's setup - please let us know.

This feature will be opt-in on the SDK side. So, the default behavior will remain as is.

But if SDK sends some flag that indicates that it will track the impression, the PBS shouldn't cache the respective URLs.

The proposed OpenRTB request field: $.ext.prebid.sdk.nativeimptracker. The value should be 1 to activate the feature. The affected fields: so far we propose to extract the following fields before caching:

  • bid.burl
  • bid.ext.prebid.events.imp

Later, this list can be expanded.

YuriyVelichkoPI avatar Jan 15 '25 11:01 YuriyVelichkoPI

I'd propose we expand any refactoring here to include a more general tracking-of-multiple-things approach like the one suggested at https://github.com/prebid/Prebid.js/issues/12216#issuecomment-2362233668

Prebid.js 9.31 and later fire seatbid[].bid[].ext.eventtrackers[] with types 1 (imp) and 500 (win). It will fire them both at the same time unless the page has declared the "deferBilling" option.

There are 4 sets of tracking that PBS could emit:

  1. seatbid.bid.ext.prebid.events - the 'win' event is consumed by the PBSbidAdapter and fired as a BIDS_WON event. PBSDK fires the win event in the "Prebid-Rendered" scenarios.
  2. When instructed to cache bids, PBS adds PBC entries: wurl and burl - the PUC fires these URLs in the mobile app and AMP scenarios.
  3. This new seatbid[].bid[].ext.eventtrackers[] - the idea is that we would place win and/or imp events in this array where PBSDK and PBJS would fire them at the appropriate times instead of using either approaches 1 or 2 above. (See proposed account-level config below for an event filter)
  4. When instructed to cache bids, PBS adds eventtrackers[] to what's cached in PBC. It does not add wurl or burl.

Here's a proposal:

  1. A new request flag indicates that the client wants the tracking strings on seatbid[].bid[].ext.eventtrackers. The flag proposal is ext.prebid.options.trackloc: 2. (1=the old location, which is the default)
  2. If trackloc: 1, PBS returns tracking on legacy scenario locations 1 and 2 above.
  3. If trackloc: 2, PBS returns tracking on new scenario locations 3 and 4 above:
    1. If seatbid[].bid[].ext.eventtrackers already exists in the ORTB response, PBS should assume the bidder has placed its tracking URLs there already. If it doesn't exist, PBS should create it and add any burl found in the response. (add as event: 1, method: 1)
    2. PBS should add its own win and imp tracking URLs. (win is event 500, imp is event 1)
    3. PBJS can merge the PBS-supplied array with URLs received from other bid adapters.
    4. Upon BIDS_WON and IMP events, the client is expected to loop through the array:
      1. Look at the 'type' field. If type=1, then this pixel should be triggered when in view. If type=500, it's triggered when the ad server reports the win.
      2. Look at the 'method' field. If 1, drop an . Otherwise do nothing.
  4. Support a new account-level configuration to control whether both win and imp events are emitted. Up until now, it's been fine to always emit both, but with the client changes, there's now a fairly common scenario where both events would be emitted at the same time. This increases analytics volume and cost substantially if there's no business benefit. E.g. for PBJS customers that have not installed a bidViewability module of some sort, it would best to not emit imp events. So the proposal is to add two more account-level flags: auction.eventtrackers.wins.enabled:true and auction.eventtrackers.imps.enabled:true. Both default to true but would be ignored if the existing auction.events.enabled:false. If false, the win or imp would not get added to seatbid[].bid[].ext.eventtrackers[].

Here's how this would work for various scenarios:

  1. When a publisher has upgraded to PBJS v9.31 or later, they can add extPrebid.options.trackloc:2 to their s2sConfig. This tells Prebid Server to utilize the new location. PBJS should handle the change smoothly, but there will be a side-effect: PBS will get both WIN and IMP events. The analytics system needs to be prepared for that.
  2. A future version of PB SDK would send ext.prebid.options.trackloc:2 in the request when it wants the tracking on the new location. The PUC would stop seeing wurl and burl in the PBC entries and stop tracking, with the assumption being that the new SDK render code will smoothly pick up tracking because it would start seeing eventtrackers.
  3. The AMP endpoint would not inject trackloc:2 into the request so those PBC entries would continue to get wurl and burl so the PUC can track as it does today.

bretg avatar Jan 16 '25 19:01 bretg

Support for seatbid[].bid[].ext.eventtrackers[] was added to Prebid.js 9.31 in February 2025.

If seatbid.bid.burl is in the ORTB response, PBJS adds it as an impression tracker, If seatbid.bid.ext.prebid.events.win is present, it adds a win tracker. Both are put in the bid response eventtracker array and core later fires them if necessary

bretg avatar Apr 09 '25 13:04 bretg

@YuriyVelichkoPI is this still of interest? If so, perhaps we can discuss at the next backlog call.

bsardo avatar Nov 13 '25 15:11 bsardo