Server-Side UID2 Integration Example

This example demonstrates how a content publisher can use UID2 services to implement the server-side UID2 integration workflow. [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.
no
Advertising Token:
?
The encrypted UID2 token that is passed to ad systems without exposing raw user identity. It is automatically refreshed by the server when expired.
undefined
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.
yes
Has Opted Out?
?
Indicates if the user has opted out of UID2. When true, no advertising token is generated or stored.
no
Identity State:
?
The complete identity object from the server. Contains the full UID2 identity data including refresh tokens and metadata.
null