prebid / prebid-server

Open-source solution for running real-time advertising auctions in the cloud.
https://prebid.org/product-suite/prebid-server/
Apache License 2.0
434 stars 743 forks source link

Suppress transaction IDs #2727

Open bretg opened 1 year ago

bretg commented 1 year ago

In contrast to the buyer-initiated effort to add imp.ext.tid in https://github.com/prebid/prebid-server/issues/2381, we now need to partly walk that change back.

Requirements

  1. The Prebid Publisher committee has determined that neither Prebid.is nor Prebid Server should send source.tid or imp.ext.tid to bidders by default.
  2. It should be possible for accounts to opt-in to sending these values to bidders.
  3. Analytics adapters should be able to receive these tid values.
  4. We may need to add $.id into the list at some point.

Implementation

We discussed in committee two options for building this feature:

After discussing these options, a new 'transmitTid' activity has been added to section 3.3.4 of https://docs.google.com/document/d/1dRxFUFmhh2jGanzGZvfkK_6jtHPpHXWD7Qsi6KEugeE/edit#

To support the desire for suppression to be default, the PBJS team would like to send us a behavioral flag:

ext.prebid.createtids: false

If this flag is present and false, the code that enforces the transmitTid activity when preparing the bidder requests should remove / not add source.tid and imp.ext.tid.

Note that we do not intend to implement a general activity override on the ORTB request due to complexities in determining priority of request-parameters vs the activity config. So this is considered a one-off feature. If at some point we decide that request-level control of activities is a general requirement, there will be a separate set of requirements.

SyntaxNode commented 1 year ago

Item 4 was discussed in Backlog Grooming. Per recommendation of the Committee, I created a new issue https://github.com/prebid/prebid-server/issues/2794 to discuss how to handle the request id.

bretg commented 1 year ago

Spoke with the Prebid.js team. They're going to name this activity transmitTid. They pointed out that the "any false" rule makes the idea of supporting an inverse activity problematic.

Would like to discuss in the next committee meeting

bretg commented 1 year ago

Discussed in PBS committee and agreed on transmitTid

bretg commented 1 year ago

Flipped back to Needs Requirements until we can discuss the newly proposed request-level flag ext.prebid.createtids

bretg commented 1 year ago

Discussed in committee.

There will be two ways of controlling the passing of imp.ext.tid:

  1. the request carries ext.prebid.createtids:false. If this flag is false, then PBS won't create tids. The default for ext.prebid.createtids is true.
  2. the account-level config disallows the transmitTids activity. If this is disallowed, then PBS will remove imp.ext.tid from bidder, analytics, and modules. This behavior can be controlled through Activity Control conditions.

The relevant code in Prebid.js is https://github.com/prebid/Prebid.js/blob/e1acefe45a251c49eae3b538b71eea973bf5d860/modules/prebidServerBidAdapter/ortbConverter.js#L78

bretg commented 1 year ago

To clarify how this integrates with https://github.com/prebid/prebid-server/issues/2381...

  1. If request parameter ext.prebid.createtids=false, then the transmitTid activity is overridden to disallowed.
  2. If request parameter ext.prebid.createtids=true, then the transmitTid activity is overridden to allowed.
  3. ext.prebid.createtids does not have a default, meaning transmitTid is utilized.

There are two specific tasks tied to the transmitTid activity

$.source.tid

if source.tid is not set and the transmitTid activity is allowed:
   set source.tid to a random UUID  // existing behavior
// new behavior
if host config generate-storedrequest-bidrequest-id config is true and the transmitTid activity is allowed
    if the storedrequest is from AMP or from a top-level stored request (ext.prebid.storedrequest), then replace any existing $.source.tid with a random value
if $.source.tid contains "{{UUID}}", replace that macro with a random value

$.imp[].ext.tid

for each imp:
   if imp[n].ext.tid is not set and the transmitTid activity is allowed:
       set imp[n].ext.tid to a randomly generated UUID
   if host config generate-storedrequest-bidrequest-id config is true and the transmitTid activity is allowed
       if the storedrequest is from AMP or from a top-level stored request (ext.prebid.storedrequest), then replace any existing $.imp[n].ext.tid with a random value
  if $.imp[n].ext.tid contains "{{UUID}}", replace that macro with a random value

Note: there are no changes for .id and .imp[].id in this issue, but see https://github.com/prebid/prebid-server/issues/2794

bretg commented 8 months ago

Done with PBS-Java 2.2