You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Code Repository with Readme](https://github.com/IABTechLab/uid2-web-integrations/tree/main/examples/js-sdk)
30
-
31
25
## Introduction
32
26
33
27
This guide outlines the basic steps that you need to consider if you are building an integration without using an SDK. For example, you need to decide how to implement user authentication and data capture, how to manage UID2 identity information and use it for targeted advertising, and how to refresh tokens, deal with missing identities, and handle user opt-outs.
@@ -36,7 +30,7 @@ For a workflow diagram, see [Integration Steps](#integration-steps). See also [F
36
30
37
31
For details about the UID2 opt-out workflow and how users can opt out, see [User Opt-Out](../getting-started/gs-opt-out.md).
38
32
39
-
To facilitate the process of establishing client identity using UID2 and retrieving advertising tokens, the web integration steps provided in this guide rely on the SDK for JavaScript. Here's an [example application](https://example-jssdk-integ.uidapi.com/) that illustrates the integration steps described in this guide and the usage of the SDK (currently only for email addresses). For the application documentation, see [UID2 SDK Integration Example](https://github.com/IABTechLab/uid2-web-integrations/tree/main/examples/js-sdk).
33
+
To facilitate the process of establishing client identity using UID2 and retrieving advertising tokens, the web integration steps provided in this guide rely on the SDK for JavaScript. For an example, see [Sample Implementation](#sample-implementation).
40
34
41
35
:::tip
42
36
The first-party cookie and local storage implementation details might change in the future. To avoid potential issues, be sure to rely on the functionality documented in the [SDK for JavaScript API Reference](../sdks/sdk-ref-javascript.md#api-reference) for your identity management.
@@ -175,6 +169,13 @@ The client lifecycle is complete when the user decides to log out from the publi
175
169
</script>
176
170
```
177
171
172
+
## Sample Implementation
173
+
174
+
A sample implementation is available for client-server integration using the UID2 SDK for JavaScript:
175
+
176
+
- Site: [Client-Server UID2 Integration Example using JavaScript SDK](https://js-client-server.samples.uidapi.com/)
Copy file name to clipboardExpand all lines: docs/guides/integration-prebid-client-server.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,6 @@ Information about how to integrate Prebid with UID2 is also in the following loc
36
36
- On the Prebid site, on the [Unified ID 2.0](https://docs.prebid.org/dev-docs/modules/userid-submodules/unified2.html) page for the Prebid User ID submodule.
37
37
- In the Prebid GitHub repository, on the [UID2 User ID Submodule](https://github.com/prebid/Prebid.js/blob/master/modules/uid2IdSystem.md) page.
38
38
39
-
<!-- ## Integration Example
40
-
41
-
GWH note 12/14/23 updated 2/7/25: we have a client-side example for Prebid.js but no client-server example. -->
42
-
43
39
## Integrating with Single Sign-On (SSO)
44
40
45
41
<SnptIntegratingWithSSO />
@@ -394,3 +390,11 @@ if you're using Prebid.js, and you're planning to pass UID2 tokens to Google usi
394
390
395
391
- 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).
396
392
- Update your Prebid.js configuration: see [Optional: Enable Secure Signals in Prebid.js](integration-google-ss.md#optional-enable-secure-signals-in-prebidjs).
393
+
394
+
## Sample Implementation
395
+
396
+
The following sample implementation is available to illustrate how to integrate UID2 with Prebid.js using client-server integration:
397
+
398
+
- Client-server integration example using Prebid.js:
399
+
- Site: [Client-Server UID2 Integration with Prebid.js](https://prebid-client-server.samples.uidapi.com/)
Copy file name to clipboardExpand all lines: docs/guides/integration-prebid-client-side.md
+58-7Lines changed: 58 additions & 7 deletions
Display the source diff
Display the rich diff
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
27
27
28
28
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.
29
29
30
-
## Integration Example
31
-
32
-
An example of the UID2 Prebid.js client-side integration is available at the following links:
## Optional: Deferred Client-Side UID2 Configuration with mergeConfig
202
+
203
+
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:
204
+
205
+
-[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.
206
+
-[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.
207
+
208
+
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:
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.
235
+
236
+
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.
237
+
:::
238
+
239
+
A sample implementation for deferred configuration is also available. For details, see [Sample Implementations](#sample-implementations).
240
+
208
241
## Optional: Prebid.js Integration with Google Secure Signals
209
242
210
243
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:
211
244
212
245
- 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).
213
246
- Update your Prebid.js configuration: see [Optional: Enable Secure Signals in Prebid.js](integration-google-ss.md#optional-enable-secure-signals-in-prebidjs).
247
+
248
+
A sample implementation for Prebid.js with Secure Signals is also available. For details, see [Sample Implementations](#sample-implementations).
249
+
250
+
## Sample Implementations
251
+
252
+
The following sample implementations are available to illustrate how to integrate UID2 with Prebid.js on the client side:
253
+
254
+
- Client-side integration example using Prebid.js:
255
+
- Site: [Client-Side UID2 Integration with Prebid.js](https://prebid-client.samples.uidapi.com/)
0 commit comments