UID2 Client-Server Integration Guide for Prebid.js
This guide is for publishers who have access to DII (email address or phone number) on the server side and want to integrate with UID2 and generate UID2 tokens (advertising tokens) to be passed by Prebid.js in the RTB bidstream.
This is called client-server integration because some integration steps are client-side and some are server-side.
To integrate with UID2 using Prebid.js, you'll need to:
- Make changes to the HTML and JavaScript on your site.
- Make server-side changes for token generation (and, optionally, token refresh).
Prebid.js Version
This implementation requires Prebid.js version 7.53.0 or later. For version information, see https://github.com/prebid/Prebid.js/releases.
UID2 Prebid Module Page
Information about how to integrate Prebid with UID2 is also in the following locations:
- On the Prebid site, on the Unified ID 2.0 page for the Prebid User ID submodule.
- In the Prebid GitHub repository, on the UID2 User ID Submodule page.
Integrating with Single Sign-On (SSO)
If you integrate with one or more SSO providers to offer SSO login, you might be able to retrieve the logged-in user's email address from the SSO provider to generate UID2 tokens.
For details, see Publisher Integration with SSO Providers.
Preparing DII for Processing
It's critical that the input data, which you are converting to UID2, is in an acceptable format. If it isn't, you won't get the expected results. For example, you must normalize phone numbers to include the country code, as explained in Phone Number Normalization.
For details, see Preparing Emails and Phone Numbers for Processing.
To validate the full token generation pipeline end to end, confirming that tokens generated from your normalized, hashed, and encoded values are correct, use the UID2 Token Validator.