Example: UID2 integration for publishers

This example illustrates the steps documented in the UID2 SDK Integration Guide.

The __uid2.init function from the UID2 SDK is used to load the UID2 identity from a first-party cookie, which contains an advertising token (or uid2 token) that can be used for targeted advertising.
If the UID2 identity is missing, then the user needs to authenticates and authorizes its creation.

In the background, the UID2 SDK will continuously validate if the advertising token needs to be refreshed and refreshes it automatically when needed until the refresh token expires or the user opts out, at which point the UID2 identity is cleared and the user needs to authorizes the creation of a new UID2 identity.

Ready for Targeted Advertising:
UID2 Advertising Token:
Is UID2 Login Required?
UID2 Identity Updated Counter:
UID2 Identity Callback State: