-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refining the cookie-sync process #2173
Comments
Discussed in committee. Still looking for community feedback on the details, but folks are generally ok with the idea that refining the 'full cookie' scenario is higher priority than shrinking the cookie #1985 |
Updated to integrate support for the DSP sync feature #1986 |
Added the "Creating the bidder's sync URL" section |
SetUID Edge Case Exploration
Sync URL Generation
There is a hardcoded default redirect url which can be overwritten per adapter by the host, but I expect most to just leave it as is. This default matches the expectations of the setuid endpoint which I view as a PBS configuration and not a per-adapter setting. Instead, the adapters can configure the information which is used to compose the redirect url. The default for PBS-Go is: The syncer key defaults to the bidder name, but can be overwritten. Here's an example of the AppNexus adapter config which uses a custom key:
Adapters may share the same syncer key, which is useful for aliases. If the same syncer key is used, the settings may only be defined once or else it's treated as a fatal configuration error at startup. PBS-Go Change Summary
|
Thanks for the review @SyntaxNode . First, to clarify - this proposal defines only two tiers: either a bidder is 'priority' for syncing or it's not.
I'm going to make two assumptions:
Maybe it will help to list out some times a /setuid call will be rejected:
Sounds right to me. Thanks. |
Oh, except perhaps this -- I added cookie_sync req 10
The idea is that if someone is trying to sync bidderX but that bidder can't be synced (not enabled or didn't supply sync info) the caller needs to know that or that may open a support ticket. |
Updated to add requirements 13 and 14. Renamed "bidders" in most places to "cookie-family" to cover the case of aliases. |
Updated to list out the warnings/errors |
We've noted that theres an important change happening with this revision, that I consider a bug fix, but the community should weigh in... Districtm is a server-side hard-coded alias of appnexus. Right now the behavior is If you POST to /cookie_sync
The current response is:
With this revision, the "bidder" field will become "adnxs" instead, because that's the 'cookie family' name. After this revision,
You would see:
|
The team pointed out there's host-cookie functionality in the existing endpoint that wasn't represented here. Added cookie_sync required 15 and algorithm 1.g |
Added cookie_sync step 7 and the "limit reached" edge case. |
Added reference to user.ext.prebid.buyeruids.BIDDER behavior |
released with PBS-Java 1.105 |
FYI - updated the user.buyeruid section to deal with aliases. |
Closing this issue after necessary updates for PBS-Go related to refining the cookie_sync process have been implemented and merged. |
Re-Opened to show I opened a minor PR: #3558, that updates one of the debug messages to match Java. |
The /cookie_sync and /setuid endpoints have grown organically over the years with features added like GDPR, coop-sync, and filters. In addition, with the growth of the number of server-side bid adapters, we're aware that the uids cookie is regularly filling up to the 4KB cookie limit for some host companies.
This issue aims to take a step back and establish a holistic set of requirements for how the overall cookie sync process should work. It may be that both PBS-Go and PBS-Java conform pretty closely to this already, but there are certainly a few changes, particularly in relation to how /setuid deals with the full-cookie scenario.
It might make sense to combine this effort with #1985, but that would likely be a larger effort so it may make sense to consider them separately.
Note, placeholders have been added to cover 'multisync' issue #1986
Config
Several configurations were placed at the "coop-sync" level that really belong up at the parent cookie-sync level. The proposal is move them around to align better with usage.
Host-Level Config
cookie-sync.default-limit
cookie-sync.max-limit
cookie-sync.default-coop-sync // remove: this is a duplication of cookie-sync.coop-sync.default
host-cookie.max-cookie-size-bytes
cookie-sync.default-timeout-ms
cookie-sync.coop-sync.default
cookie-sync.coop-sync.pri // move to the cookie-sync level
cookie-sync.coop-sync.default-limit // move to the cookie-sync level
cookie-sync.coop-sync.max-limit // move to the cookie-sync level
Account-Level Config
cookie-sync.default-timeout-ms // overrides host level config of same name
cookie-sync.coop-sync.default // overrides host-level cookie-sync.default-coop-sync
cookie-sync.coop-sync.pri // move out of coop-sync -- override host config cookie-sync.pri
cookie-sync.coop-sync.default-limit // move out of coop-sync -- override host config cookie-sync.default-limit
cookie-sync.coop-sync.max-limit // move out of coop-sync -- override host config cookie-sync.max-limit
cookie-sync.multisync-bidders: ["bidderA"] // new config for multisync
/cookie_sync
/cookie_sync requirements
First, it's important to note that the unit of cookie-syncing is the "cookie family", not a bidder code. If the page requests syncing for a bidder code that's a hardcoded alias, what comes back from PBS would be the 'family', not that bidder code. e.g. a request for 'trustx' would cause a sync for 'grid'.
Here are the high level requirements for the whole process
uids
and the actual host cookie ever get out of sync./cookie_sync endpoint
Algorithm for /cookie_sync:
a) The 'bidders' parameter links to a 'cookie-family'. Aliased bidders may map to the same cookie-family as the source bidder. So the /cookie-sync endpoint needs to map 'bidders' to 'cookie-families' and de-dupe.
b) if coop-sync is off, then the list of cookie-families is (A) those present on the request that aren't already in the uids cookie or are present but expired. (B) Any unexpired cookie-families in the cookie for which multisync is active.
c) otherwise, if coop-sync is on, then add to the list of all cookie-families that supply one or more sync URLs but remove those already in the uids cookie and done with multisync
d) we now have the list of all cookie-families that want to drop a pixel or iframe
e) if any bidders present on the request are unknown, add the "unknown bidder" error to the response if the debug flag is true
f) if any bidders present on the request don't have cookie-sync config, add the "no sync config" error to the response if the debug flag is true
g) check to see if the host-cookie needs to be resynced. This is an old use-case that we discovered sometimes the host-cookie's entry in uids can get out of sync with the host-cookie itself. It's arguable that the host-cookie doesn't need to be in the uids cookie at all, but will push that feature to another issue. Just documenting what the current endpoint does.
i) Find the host-cookie value from the host-cookie.family and host-cookie.cookie-name configurations, and looking for such a cookie coming into the /cookie_sync endpoint.
ii) If not found, done. Else if found, then look for the existing value of host-cookie.family in the uids cookie.
ii) If the host-cookie-family has the same value in both uids and from the direct host-cookie, then we're done. Else, add the host-cookie-family to the list of families to (re)sync.
a) If a cookie-family is removed due to filter settings, log a metric cookie-sync.FAMILY.filtered. Add this to the client response if debug is true.
a) request specifies gdpr:1
b) request doesn't specify gdpr and IP lookup shows the user in the EEA
c) if a cookie-family's GVLID is blocked, log cookie-sync.FAMILY.tcf.blocked metric
d) add the "Rejected by TCF" error to the response if the debug flag is true
a) /cookie_sync request limit (capped by cookie-sync.max-limit)
b) cookie-sync.default-limit
c) otherwise, if neither config is specified, let the default cookie-sync.default-limit be 2.
a) add a cookie-family specified on the request
b) add any multisync cookie-families already in the uids cookie and not done with multisync
c) if coop-sync is on
i) add a cookie-families in cookie-sync.pri that's not already in the cookie
ii) if no bidders remaining in 'pri', add a random cookie-family from the remainder of the list
d) check if the cookie size limit has been reached. if no, skip the cookie-family. if yes, we may decide to emit the sync url anyhow. Resyncing multisync cookie-families already in the uids cookie don't count towards the cookie size limit since they don't go in more than once.
i) if the current cookie-family is on the 'pri' list but not in the cookie, go ahead and add it the response anyhow. /setuid may eject a non-priority cookie-family
e) check if the limit of new cookie-families has been reached for this /cookie_sync. If so, we're done.
Here are the messages that come out of the /cookie_sync process:
if the bidder/family was listed in the original request:
Creating the cookie-families sync URL
A single usersync type of iframe/redirect is not quite enough to correctly cover all the use cases:
Proposed algorithm:
a) See Support both image and iframe usersyncs #1554 for details
a) Resolve {{gdpr, etc}} macros
b) support config for the the cookie-family's UID macro
c) support config for overriding the 'format' parameter
d) it should be possible for a bidder to not have a redirect URL sent. Some, like Rubicon, configure that on their side.
The /setuid endpoint
/setuid requirements
High level requirements for setuid
/setuid endpoint
Algorithm for /setuid
a) check GDPR permissions for the the cookie-family if the request specifies gdpr=1 or if gdpr not specified and the IP address resolves to the EEA. Note that this assumes the cookie-family name can be looked up for GVLID.
b) if allowed by GDPR, add the cookie-family, encode it, and recheck the size
c) if not allowed by GDPR, log metric 'usersync.BIDDER.tcf.blocked' and respond with the cookie-family not added
a) if there is a 'pri' list and the current cookie-family is not on it, ignore the bidder, don't add the cookie-family to the response set-cookie. Log a metric for 'usersync.FAMILY.sizeblocked'
b) if there is a 'pri' list and the current cookie-family is on it, first check GDPR allows this cookie-family as above. If not, log metric 'usersync.FAMILY.tcf.blocked'
i) remove the oldest cookie-family uid that's not on the pri list. Log a metric for the kicked-out bidder 'usersync.FAMILY.sizedout'
Utilizing the uids cookie and the host cookie in the /auction endpoint
There's no change in this area, but for completeness, the final utility of the uids cookie is to pass
user.buyeruid
to bid adapters.When creating each bidder-specific ORTB request:
a. Look for an incoming cookie by the name defined in "host-cookie.cookie-name". e.g. for Rubicon, this is "khaos", for Appnexus, this is "uid".
b. If the cookie defined by host-cookie.cookie-name exists, copy its value to user.buyeruid
The text was updated successfully, but these errors were encountered: