-
Notifications
You must be signed in to change notification settings - Fork 50
Update UID2 docs to include up-to-date links and references to sample pages #966
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
Merged
eiman-eltigani-ttd
merged 13 commits into
main
from
eee-UID2-5180-add-documentation-for-prebid-deferred
Dec 29, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a489799
make changes to integrations page + add sections for prebid deferred …
eiman-eltigani-ttd c105d5d
ensure doc titles match webpage headers
eiman-eltigani-ttd 342d70b
update description headers for each of the sites
eiman-eltigani-ttd 930364c
update instructions for deferred prebid in client side page
eiman-eltigani-ttd ed322bc
update instances of secure signal to secure signals
eiman-eltigani-ttd 486b4ca
update title link to match destination for prebid deferred
eiman-eltigani-ttd 599f335
update description sentence per feedback
eiman-eltigani-ttd 4cbb4ee
put links in correct destination and add cross reference for google ss
eiman-eltigani-ttd 1427723
add and update sample implementation sections for prebid
eiman-eltigani-ttd 40fd39a
update links for js sdk
eiman-eltigani-ttd 9c41ac1
add note regarding phone numbers and update deferred title
eiman-eltigani-ttd a8a39a8
remove repeat word in same sentence
eiman-eltigani-ttd 92be1c9
fix order of sample implementation section before faq
eiman-eltigani-ttd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,13 +27,6 @@ This implementation requires Prebid.js version 8.21.0 or later. For version info | |
|
|
||
| If you need to use an earlier version of Prebid.js, use the implementation solution presented in the [UID2 Client-Server Integration Guide for Prebid.js](integration-prebid-client-server.md) instead. | ||
|
|
||
| ## Integration Example | ||
|
|
||
| An example of the UID2 Prebid.js client-side integration is available at the following links: | ||
|
|
||
| - Code: [Example Prebid.js UID2 Integration](https://github.com/IABTechLab/uid2docs/tree/main/static/examples/cstg-prebid-example) | ||
| - Running site: [UID2 Prebid.js Client-Side Integration Example](https://unifiedid.com/examples/cstg-prebid-example/) | ||
|
|
||
| ## Integrating with Single Sign-On (SSO) | ||
|
|
||
| <SnptIntegratingWithSSO /> | ||
|
|
@@ -205,9 +198,67 @@ pbjs.setConfig({ | |
| }); | ||
| ``` | ||
|
|
||
| ## Optional: Deferred Client-Side UID2 Configuration with mergeConfig | ||
|
|
||
| If you already have Prebid.js configured but didn't include UID2 in the initial setup, you can still add the UID2 module using two functions provided by Prebid.js: | ||
|
|
||
| - [mergeConfig()](https://docs.prebid.org/dev-docs/publisher-api-reference/mergeConfig.html): Merges new configuration into the existing Prebid config without overwriting other settings. Use this to add the UID2 module to your existing `userSync.userIds` array. | ||
| - [refreshUserIds()](https://docs.prebid.org/dev-docs/publisher-api-reference/refreshUserIds.html): Reruns the user ID submodules to fetch the latest IDs. Call this after `mergeConfig()` to trigger UID2 token generation. | ||
|
|
||
| You still pass the same configuration information as described above (API base URL, credentials, and DII) so that Prebid can handle the entire UID2 token lifecycle: | ||
|
|
||
| ```js | ||
| // Step 1: Define the UID2 configuration | ||
| const uidConfig = { | ||
| userSync: { | ||
| userIds: [{ | ||
| name: 'uid2', | ||
| params: { | ||
| uid2ApiBase: 'https://operator-integ.uidapi.com', | ||
| email: '[email protected]', | ||
| subscriptionId: subscriptionId, | ||
| serverPublicKey: publicKey | ||
| } | ||
| }] | ||
| } | ||
| }; | ||
|
|
||
| // Step 2: Merge UID2 config into existing Prebid config (additive, won't overwrite) | ||
| pbjs.mergeConfig(uidConfig); | ||
|
|
||
| // Step 3: Trigger user ID refresh to generate the token | ||
| await pbjs.refreshUserIds({ submoduleNames: ['uid2'] }); | ||
| ``` | ||
|
|
||
| :::note | ||
| Once you add UID2 to your configuration, Prebid does not provide functionality to remove individual submodules without overwriting the entire `userIds` array. For client-side integrations where Prebid has access to the UID2 token in localStorage, it is important to clear localStorage where the token is stored after the user logs out and reload the page to clear caches. This prevents future bid requests from using the identity. | ||
|
|
||
| If you are managing the UID2 SDK separately, use `window.__uid2.disconnect()` which handles all logout functionality—clearing both memory and storage—without requiring a page refresh. | ||
| ::: | ||
|
|
||
| A sample implementation for deferred configuration is also available. For details, see [Sample Implementations](#sample-implementations). | ||
|
|
||
| ## Optional: Prebid.js Integration with Google Secure Signals | ||
|
|
||
| if you're using Prebid.js, and you're planning to pass UID2 tokens to Google using Google Secure Signals, there are a couple of additional configuration steps: | ||
|
|
||
| - In your Google Ad Manager account, make sure that encrypted signals are properly shared with third-party bidders: see [Allow Secure Signals Sharing](integration-google-ss.md#allow-secure-signals-sharing). | ||
| - Update your Prebid.js configuration: see [Optional: Enable Secure Signals in Prebid.js](integration-google-ss.md#optional-enable-secure-signals-in-prebidjs). | ||
|
|
||
| A sample implementation for Prebid.js with Secure Signals is also available. For details, see [Sample Implementations](#sample-implementations). | ||
|
|
||
| ## Sample Implementations | ||
|
|
||
| The following sample implementations are available to illustrate how to integrate UID2 with Prebid.js on the client side: | ||
|
|
||
| - Client-side integration example using Prebid.js: | ||
| - Site: [Client-Side UID2 Integration with Prebid.js](https://prebid-client.samples.uidapi.com/) | ||
| - Code: [uid2-examples/web-integrations/prebid-integrations/client-side](https://github.com/IABTechLab/uid2-examples/tree/main/web-integrations/prebid-integrations/client-side) | ||
| - Deferred client-side integration example using Prebid.js: | ||
| - Site: [Deferred Client-Side UID2 Integration with Prebid.js](https://prebid-deferred.samples.uidapi.com/) | ||
genwhittTTD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Code: [uid2-examples/web-integrations/prebid-integrations/client-side-deferred](https://github.com/IABTechLab/uid2-examples/tree/main/web-integrations/prebid-integrations/client-side-deferred) | ||
| - Client-side integration example using Prebid.js with Google Secure Signals: | ||
| - Site: [Client-Side UID2 Integration with Prebid.js (with Google Secure Signals)](https://prebid-secure-signals.samples.uidapi.com/) | ||
| - Code: [uid2-examples/web-integrations/prebid-secure-signals](https://github.com/IABTechLab/uid2-examples/tree/main/web-integrations/prebid-secure-signals) | ||
|
|
||
| Each sample implementation has its own instructions. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.