UID2 Integration Overview for Prebid
This guide is an overview of integration options for publishers who want to integrate with UID2 and generate UID2 tokens (advertising tokens) to be passed by Prebid.js or the Prebid Mobile SDK in the RTB bidstream.
Prebid.js Support for Web
UID2 provides a Prebid.js module that supports the following:
- Generating the UID2 token
- Refreshing the UID2 token
- Storing the UID2 token in the browser
- Passing the UID2 token to the bidstream
For additional flexibility, UID2 also provides alternative methods for some of the features and complementary products, such as a JavaScript SDK.
UID2 is not designed to be used where GDPR applies. The module checks the consent data that's passed in, and does not operate if the gdprApplies
flag is set to true
.
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.
Generating the UID2 Token
Depending on access to DII, there are two methods to generate UID2 tokens for use with Prebid.js, as shown in the following table.
Determine which method is best for you, and then follow the applicable integration guide.
Scenario | Integration Guide |
---|---|
You have access to DII on the client side and want to do front-end development only | UID2 Client-Side Integration Guide for Prebid.js |
You have access to DII on the server side and can do server-side development | UID2 Client-Server Integration Guide for Prebid.js |