Unified ID 2.0 / The Trade Desk

In this article, you will learn how to integrate with The Trade Desk's identity solution by generating a UID2 token and pass it into the Nimbus request.

IAB UID2 Specification

UID2 is a framework that enables deterministic identity for advertising opportunities on the open internet for many participants across the advertising ecosystem.

To learn more about the UID2 specification, go to https://unifiedid.com/docs/intro.

The Trade Desk API Credentials

To get an API Key and Secret to use the API, set up a UID2 account. Send an email to UID2publishers@thetradedesk.com, and include the details listed in

https://unifiedid.com/docs/getting-started/gs-account-setup.

Generating a UID2 Token:

Publishers using the Nimbus SDK are responsible for generating a UID2 token for each user with the UID2 API. For information about how to implement UID2 as a publisher, including a workflow diagram, see https://unifiedid.com/docs/overviews/overview-publishers. Publishers will have to do this on their server-side back-end systems.

In the UID2 API, the POST /token/generate endpoint generates the UID2 token. The publisher must cache the data returned from this endpoint and must refresh the token periodically using the POST token/refresh.

All tokens include a “refresh_from” timestamp. It's important to refresh the token in plenty of time so that it does not expire.

There are two types of consent that must be adhered to:

  1. Global UID2 Consent - The user can opt-out of targeted advertising based on UID2 via the UID2 Transparency and Control Portal. Publishers should provide links to this portal in their login flows, consent flows, privacy policies, or by other means. To ensure a UID2 is not being generated and sent to Nimbus for a user who has opted out through this portal, you can set token generation policy = 1 in POST /token/generate and verify that the POST token/refresh endpoint response doesn’t contain the “optout” status.

  2. App-specific consent - The app must only generate and pass the UID2 to Nimbus if it has the user’s consent to share his/her data for advertising purposes. These disclosures are generally included as part of an app's compliance with existing data-sharing regulations such as GDPR, CCPA, or platform policies enforced by Apple or Google.

Passing the UID2 Token to the Nimbus SDK

Once a token is obtained, the Nimbus SDK provides a helper function to enable adding the token as an EID to the ad request.

// Add EID globally to all requests
NimbusAdManager.addExtendedId(source = "uidapi.com", id = "UID2-Token")

// Add EID per request. This will override the global EIDs list
lateinit var nimbusRequest: NimbusRequest

nimbusRequest.apply {
   addExtendedId(source = "uidapi.com", id = "UID2-Token")
}

Useful FAQs

Frequently Asked Questions | Unified ID 2.0

Publishers | Unified ID 2.0

Last updated