Client-Side UID2 Integration Example using JavaScript SDK
This example demonstrates how a content publisher can integrate UID2 using client-side token generation, where the SDK generates tokens directly in the browser using public credentials. For documentation, see the Client-Side Integration Guide for JavaScript. [Source Code]
UID2 Integration Status
|
Ready for Targeted Advertising:
?
Indicates whether a valid UID2 token is present and can be used for personalized ad targeting.
|
|
|
Advertising Token:
?
The encrypted UID2 token that is passed to ad systems without exposing raw user identity. It is automatically refreshed by the SDK in the background when expired.
|
|
|
Is Login Required?
?
Indicates whether a new UID2 token needs to be generated. Returns "yes" when no valid identity exists or the current identity has expired.
|
|
|
Has opted out?
?
Shows whether the user has exercised opt-out, in which case no advertising token may be generated or used.
|
|
|
Identity Callback State:
?
The complete identity object returned by the SDK. Contains the full UID2 identity data including refresh tokens and metadata.
|