diff --git a/faq/prebid-server-faq.md b/faq/prebid-server-faq.md index 95a3091dac..616c9f2a6a 100644 --- a/faq/prebid-server-faq.md +++ b/faq/prebid-server-faq.md @@ -70,34 +70,9 @@ pbjs.setConfig({ ``` ## How do user ID cookies and ID syncing work in Prebid Server? -There are 3 answers here. The easy answer is for requests coming into Prebid Server from the Prebid SDK - there's no concept of cookies there, so no syncing takes place in that scenario. ID in mobile is based on IDFA. - -For other scenarios, Prebid Server sets up and manages a multi-vendor ID match table in the `uids` cookie in the host company's -domain. i.e. adnxs.com, rubiconproject.com, or whichever Prebid Server vendor you're utilizing. When the user has a `uids` cookie, -Prebid Server parses it and passes the vendor-specific IDs to the relevant server-side bid adapters. - -Syncing in the AMP scenario uses the [load-cookie.html](/dev-docs/show-prebid-ads-on-amp-pages.html#user-sync) file that's part of -the Prebid Universal Creative package. When placed into an AMP-iframe, this file will call /cookie-sync and initiate a sync that -creates or updates the `uids` cookie. - -The most common source of requests for Prebid Server is from Prebid.js in a scenario where the user doesn't have any cookies for the Prebid Server domain. -1. The user loads a page with Prebid.js that's going to call Prebid Server -- i.e. the pub has set up s2sConfig. -2. Immediately after confirming that s2sConfig is setup, Prebid.js calls Prebid Server's /cookie-sync endpoint to initiate syncing -3. Prebid Server determines there is no `uids` cookie and responds to the browser with a list of pixel syncs for bidders that need to be synced. -4. Prebid.js places all of the pixels on the page and initiates the auction. -5. Because the syncs haven't completed, the auction call to Prebid Server will not contain the uids cookie. -6. The first auction occurs without IDs -7. At some point later, the pixels come back to Prebid Server through a /setuid redirect, setting (or updating) the uids cookie. -8. The second page view will have the IDs available. - - - -{: .alert.alert-info :} -Note: the company that's hosting Prebid Server can configure it to read and utilize their exchange's -native cookie. i.e. if you're using Rubicon Project's Prebid Server, it can read their 'khaos' cookie, and if you're using -AppNexus' Prebid Server, it can read their 'uuid2' cookie. In other words, if the host company is an exchange and the user -has the exchange cookie, the host company will have an ID one page-view sooner than the other bidders. This gives a slight edge to -the hosting company in some scenarios, but it's technically unavoidable and better for both buyers and sellers to have one ID available rather than zero. +For Prebid SDK there's no concept of cookies, so no syncing takes place in that scenario. ID in mobile is based on IDFA. + +For Prebid.js and AMP, see [Prebid Server User ID sync](/prebid-server/developers/pbs-cookie-sync.html) ## How does Prebid Server support privacy signals? diff --git a/prebid-server/developers/pbs-cookie-sync.md b/prebid-server/developers/pbs-cookie-sync.md index 921f5b8a9f..5f7de31627 100644 --- a/prebid-server/developers/pbs-cookie-sync.md +++ b/prebid-server/developers/pbs-cookie-sync.md @@ -6,6 +6,10 @@ title: Prebid Server | Developer | User ID Sync --- # Prebid Server User ID Sync +{: .no_toc} + +* TOC +{:toc} ## Motivation @@ -21,7 +25,11 @@ Prebid Server stores bidder IDs in the `uids` cookie in the host domain. For exa {"uids":{},"tempUIDs":{"adnxs":{"uid":"4722255122219375043","expires":"2020-07-30T22:10:28.961Z"},"triplelift":{"uid":"9328941297032053459","expires":"2020-07-30T22:10:33.496Z"},"yieldone":{"uid":"8c41c3b1-ce22-44fd-9bd7-454cd79e3c91","expires":"2020-07-30T22:10:33.229Z"},"ix":{"uid":"XlV6w9HM6LYAAHx2YJ4AAACZ&476","expires":"2020-07-30T22:10:31.916Z"},"yieldmo":{"uid":"ge515bd6c7da71cdc98a","expires":"2020-07-30T22:10:32.569Z"},"adform":{"uid":"1707054018971720697","expires":"2020-07-30T22:10:30.453Z"},"brightroll":{"uid":"y-S8Fq5QZ1lwWKPeXdoZ9vSeZx47maINFrJeY53pDtokA2FlaPmwvrJg--","expires":"2020-07-30T22:10:29.867Z"},"consumable":{"uid":"ue1-sb1-aa634f4b-d618-4378-b8c3-9baa56dcb91a","expires":"2020-07-30T22:10:28.07Z"},"pubmatic":{"uid":"2ECE1904-7EB2-4C38-98A4-38E97535AA9C","expires":"2020-07-30T22:10:27.559Z"},"rubicon":{"uid":"KACWYIER-P-59CH","expires":"2020-07-30T22:22:42.432Z"},"pulsepoint":{"uid":"dcxvyKqDV5VV","expires":"2020-07-30T22:10:26.915Z"},"sovrn":{"uid":"bad97f98b08c9204fe6b9826","expires":"2020-07-30T22:10:25.588Z"},"openx":{"uid":"f1f4ac13-99f8-46da-82f8-b52c29b378e0","expires":"2020-07-30T22:10:25.93Z"}},"bday":"2020-05-18T20:01:18.934Z"} ``` -Here's how these IDs get placed in the cookie: +## Setting the uids Cookie + +### Setting the uids cookie from Prebid.js + +Here's how these IDs get placed in the cookie from Prebid.js: ![Prebid Server Cookie Sync](/assets/images/prebid-server/pbs-cookie-sync.png){:class="pb-lg-img"} @@ -46,7 +54,7 @@ POST https://prebid-server.example.com/cookie_sync 5) When the browser receives this redirect, it contacts Prebid Server, which will once again check the privacy settings and will update the `uids` cookie if allowed. -### How It Works for AMP +### Setting the uids cookie from AMP Cookie sync for AMP works in a way quite similar to Prebid.js. @@ -70,7 +78,7 @@ Note that the only two values currently valid for 'endpoint' are 'appnexus' and 3) At runtime, the `load-cookie` script just calls the Prebid Server /cookie_sync endpoint. The rest works the same as described for Prebid.js above. -## Building a Sync Endpoint +## Bidder Instructions for Building a Sync Endpoint Bidders must implement an endpoint under their domain which accepts an encoded URI for redirects. This URL should be able to accept privacy parameters: @@ -100,3 +108,9 @@ Prebid Server would then save this ID mapping of `somebidder: 132` under the coo When the client then calls `www.prebid-domain.com/openrtb2/auction`, the ID for `somebidder` will be available in the Cookie. Prebid Server will then stick this into `request.user.buyeruid` in the OpenRTB request it sends to `somebidder`'s Bidder. + +## Further Reading + +- [Prebid Server Overview](/prebid-server/overview/prebid-server-overview.html) +- [Prebid.js s2sConfig](/dev-docs/publisher-api-reference.html#setConfig-Server-to-Server) +- [Prebid AMP Implementation Guide](/dev-docs/show-prebid-ads-on-amp-pages.html)