Skip to content

Commit 73628a5

Browse files
committed
refresh from main, resolve merge conflict in one file
2 parents 4a1b00d + 3718aac commit 73628a5

File tree

121 files changed

+4185
-1950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4185
-1950
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/endpoints/post-identity-map-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For details about the UID2 opt-out workflow and how users can opt out, see [User
2020
This documentation is for version 2 of this endpoint, which is not the latest version. For the latest version, v3, see [POST /identity/map](post-identity-map.md).
2121

2222
:::note
23-
If you're using the v2 version, we recommend that you upgrade as soon as possible, to take advantage of improvements. For migration guidance, see [Migration from v2 Identity Map](post-identity-map.md#migration-from-v2-identity-map).
23+
If you're using an earlier version, we recommend that you upgrade as soon as possible, to take advantage of improvements. For migration guidance, see [Migration from v2 Identity Map](post-identity-map.md#migration-from-v2-identity-map). For deprecation information, see [Deprecation Schedule: Endpoint Versions](../ref-info/deprecation-schedule.md#endpoint-versions).
2424
:::
2525

2626
## Batch Size and Request Parallelization Requirements

docs/endpoints/post-identity-map.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ displayed_sidebar: docs
77
---
88

99
import Link from '@docusaurus/Link';
10+
import POSTIdentityMapImprovements from '../snippets/_post-identity-map-improvements-v3.mdx';
1011

1112
# POST /identity/map
1213

@@ -174,7 +175,7 @@ For successfully mapped DII, the mapped object includes the properties shown in
174175
| Property | Data Type | Description |
175176
|:---------|:-----------|:--------------------------------------------------------------------------------------------------------------------------------------|
176177
| `u` | string | The raw UID2 corresponding to the email or phone number provided in the request. |
177-
| `p` | string | One of the following:<ul><li>If the current raw UID2 has been rotated in the last 90 days: the previous value.</li><li>If the current raw UID2 is older than 90 days: `null`.</li></ul> |
178+
| `p` | string | One of the following:<ul><li>If the current raw UID2 was rotated in the last 90 days: the previous raw UID2.</li><li>Otherwise: `null`.</li></ul> |
178179
| `r` | number | The Unix timestamp (in milliseconds) that indicates when the raw UID2 might be refreshed. The raw UID2 is guaranteed to be valid until this timestamp. |
179180

180181
For unsuccessfully mapped input values, the mapped object includes the properties shown in the following table.
@@ -206,19 +207,13 @@ The following sections provide general information and guidance for migrating to
206207

207208
### Version 3 Improvements
208209

209-
The v3 Identity Map API provides the following improvements over v2:
210-
211-
- **Simplified Refresh Management**: You can monitor for UID2s reaching `refresh_from` timestamps instead of polling <Link href="../ref-info/glossary-uid#gl-salt-bucket-id">salt buckets</Link> for rotation.
212-
- **Previous UID2 Access**: You have access to previous raw UID2s for 90 days after rotation for campaign measurement.
213-
- **Single Endpoint**: You use only one endpoint, `/v3/identity/map`, instead of both `/v2/identity/map` and `/v2/identity/buckets`.
214-
- **Multiple Identity Types in One Request**: You can process both emails and phone numbers in a single request.
215-
- **Improved Performance**: The updated version uses significantly less bandwidth to process the same amount of DII.
210+
<POSTIdentityMapImprovements />
216211

217212
### Key Differences Between v2 and v3
218213

219214
The following table shows key differences between the versions.
220215

221-
| Feature | V2 Implementation | V3 Implementation |
216+
| Feature | v2 Implementation | v3 Implementation |
222217
|:-------------------------------|:--------------------------------------------|:-------------------------------------------|
223218
| Endpoints Required | `/v2/identity/map` + `/v2/identity/buckets` | `/v3/identity/map` only |
224219
| Identity Types per Request | Single identity type only | Multiple identity types |
@@ -230,7 +225,7 @@ The following table shows key differences between the versions.
230225
To upgrade from an earlier version to version 3, follow these steps:
231226

232227
1. [Update Endpoint URL](#1-update-endpoint-url)
233-
2. [Update V3 Response Parsing Logic](#2-update-v3-response-parsing-logic)
228+
2. [Update v3 Response Parsing Logic](#2-update-v3-response-parsing-logic)
234229
3. [Replace Salt Bucket Monitoring with Refresh Timestamp Logic](#3-replace-salt-bucket-monitoring-with-refresh-timestamp-logic)
235230

236231
#### 1. Update Endpoint URL
@@ -249,7 +244,7 @@ url = '/v3/identity/map'
249244

250245
Update the logic for parsing the response, as shown in the following example.
251246

252-
V2 Response Parsing:
247+
v2 Response Parsing:
253248
```python
254249
# v2: Process mapped/unmapped objects with identifier lookup
255250
for item in response['body']['mapped']:
@@ -260,7 +255,7 @@ for item in response['body']['mapped']:
260255
store_mapping(original_identifier, raw_uid, bucket_id)
261256
```
262257

263-
V3 Response Parsing:
258+
v3 Response Parsing:
264259
```python
265260
# v3: Process array-indexed responses
266261
for index, item in enumerate(response['body']['email']):

docs/getting-started/gs-faqs.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Here are some frequently asked questions for advertisers and data providers usin
175175
- [Does the same DII always result in the same raw UID2?](#does-the-same-dii-always-result-in-the-same-raw-uid2)
176176
- [If two operators process the same DII, are the results the same?](#if-two-operators-process-the-same-dii-are-the-results-the-same)
177177
- [How do I know when to refresh the UID2 due to salt bucket rotation?](#how-do-i-know-when-to-refresh-the-uid2-due-to-salt-bucket-rotation)
178-
- [Do refreshed emails get assigned to the same bucket with which they were previously associated?](#do-refreshed-emails-get-assigned-to-the-same-bucket-with-which-they-were-previously-associated)
178+
- [Do refreshed emails get assigned to the same bucket that they were previously associated with?](#do-refreshed-emails-get-assigned-to-the-same-bucket-that-they-were-previously-associated-with)
179179

180180
#### How do I know when to refresh a raw UID2?
181181

@@ -198,7 +198,7 @@ A raw UID2 for a specific user changes roughly once per year. The latest version
198198

199199
For implementations that reference earlier versions of this endpoint (see [POST&nbsp;/identity/map v2](../endpoints/post-identity-map-v2.md)):
200200

201-
Even though each <Link href="../ref-info/glossary-uid#gl-salt-bucket">salt bucket</Link> is updated roughly once a year, individual bucket updates are spread over the year. This means that about 1/365th of all buckets are rotated daily. If fidelity is critical, consider calling the [POST&nbsp;/identity/buckets](../endpoints/post-identity-buckets.md) endpoint more frequently; for example, hourly.
201+
Even though each <Link href="../ref-info/glossary-uid#gl-salt-bucket">salt bucket</Link> is updated roughly once a year, individual bucket updates are spread over the year. This means that about 1/365th of all buckets are rotated daily. If fidelity is critical, consider calling the [POST&nbsp;/identity/buckets](../endpoints/post-identity-buckets.md) endpoint more frequently: for example, hourly.
202202

203203
#### How should I generate the SHA-256 of DII for mapping?
204204

@@ -224,7 +224,7 @@ If a user opts out through your website, you should follow your internal procedu
224224

225225
In general yes, the process of generating a raw UID2 from DII is the same, and results in the same value, no matter who sent the request. If two UID2 participants were to send the same email address to the [POST&nbsp;/identity/map](../endpoints/post-identity-map.md) endpoint at the same time, they would both get the same raw UID2 in response.
226226

227-
However, there is a variable factor that's used in generating the raw UID2. The underlying values are refreshed roughly once per year (for details, see [How often should raw UID2s be refreshed for incremental updates?](#how-often-should-raw-uid2s-be-refreshed-for-incremental-updates)). If these values change between one request and another, those two requests result in two different raw UID2, even when the DII is the same.
227+
However, there is a variable factor that's used in generating the raw UID2. The underlying values are refreshed roughly once per year (for details, see [How often should raw UID2s be refreshed for incremental updates?](#how-often-should-raw-uid2s-be-refreshed-for-incremental-updates)). If these values change between one request and another, those two requests result in two different raw UID2s, even when the DII is the same.
228228

229229
For more information, see [Monitor for Raw UID2 Refresh](../guides/integration-advertiser-dataprovider-overview.md#5-monitor-for-raw-uid2-refresh) in the *Advertiser/Data Provider Integration Guide*.
230230

@@ -240,13 +240,13 @@ However, if a publisher sends DII in a request for a <Link href="../ref-info/glo
240240

241241
#### How do I know when to refresh the UID2 due to salt bucket rotation?
242242

243-
Metadata supplied with the UID2 generation request indicates the <Link href="../ref-info/glossary-uid#gl-salt-bucket">salt bucket</Link> used for generating the UID2. Salt buckets persist and correspond to the underlying <Link href="../ref-info/glossary-uid#gl-dii">DII</Link> used to generate a UID2. Use the [POST&nbsp;/identity/buckets](../endpoints/post-identity-buckets.md) endpoint to return which salt buckets rotated since a given timestamp. The returned rotated salt buckets inform you which UID2s to refresh.
243+
Metadata supplied with the UID2 generation request indicates the <Link href="../ref-info/glossary-uid#gl-salt-bucket">salt bucket</Link> used for generating the UID2. Salt buckets persist and correspond to the underlying <Link href="../ref-info/glossary-uid#gl-dii">DII</Link> used to generate a raw UID2. Use the [POST&nbsp;/identity/buckets](../endpoints/post-identity-buckets.md) endpoint to return which salt buckets rotated since a given timestamp. The returned rotated salt buckets inform you which UID2s to refresh.
244244

245245
:::note
246246
We do not make any promises about when the rotation takes place. To stay as up-to-date as possible, we recommend doing the checks once per hour.
247247
:::
248248

249-
#### Do refreshed emails get assigned to the same bucket with which they were previously associated?
249+
#### Do refreshed emails get assigned to the same bucket that they were previously associated with?
250250

251251
Not necessarily. After you remap emails associated with a particular bucket ID, the emails might be assigned to a different bucket ID. To check the bucket ID, see [Generate Raw UID2s from DII](../guides/integration-advertiser-dataprovider-overview.md#1-generate-raw-uid2s-from-dii) and save the returned raw UID2 and bucket ID again.
252252

@@ -262,6 +262,7 @@ Here are some frequently asked questions for demand-side platforms (DSPs).
262262
- [Where do I get the decryption keys?](#where-do-i-get-the-decryption-keys)
263263
- [How many decryption keys may be present in memory at any point?](#how-many-decryption-keys-may-be-present-in-memory-at-any-point)
264264
- [How do I know when to refresh mapped raw UID2s?](#how-do-i-know-when-to-refresh-mapped-raw-uid2s)
265+
- [How do I know if/when the raw UID2 has rotated?](#how-do-i-know-ifwhen-the-raw-uid2-has-rotated)
265266
- [Should the DSP be concerned with latency?](#should-the-dsp-be-concerned-with-latency)
266267
- [How should the DSP maintain proper frequency capping with UID2?](#how-should-the-dsp-maintain-proper-frequency-capping-with-uid2)
267268
- [Will all user opt-out traffic be sent to the DSP?](#will-all-user-opt-out-traffic-be-sent-to-the-dsp)
@@ -288,7 +289,7 @@ There may be thousands of decryption keys present in the system at any given poi
288289

289290
#### How do I know when to refresh mapped raw UID2s?
290291

291-
See [Advertisers and Data Providers section](#how-do-i-know-when-to-refresh-a-raw-uid2).
292+
See [How do I know when to refresh a raw UID2?](#how-do-i-know-when-to-refresh-a-raw-uid2) in the FAQs for Advertisers and Data Providers.
292293

293294
#### How do I know if/when the raw UID2 has rotated?
294295

@@ -300,7 +301,7 @@ The UID2 service does not introduce latency into the bidding process. Any latenc
300301

301302
#### How should the DSP maintain proper frequency capping with UID2?
302303

303-
The UID2 has the same chance as a cookie of becoming stale. Hence, the DSP can adapt the same infrastructure currently used for cookie or deviceID-based frequency capping for UID2. For details, see [How do I know when to refresh a raw UID2?](#how-do-i-know-when-to-refresh-a-raw-uid2).
304+
The UID2 has the same chance as a cookie of becoming stale. Hence, the DSP can adapt the same infrastructure currently used for cookie or deviceID-based frequency capping for UID2. For details, see [How do I know when to refresh a raw UID2?](#how-do-i-know-when-to-refresh-a-raw-uid2)
304305

305306
#### Will all user opt-out traffic be sent to the DSP?
306307

docs/getting-started/gs-normalization-encoding.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ An email hash is a Base64-encoded <Link href="../ref-info/glossary-uid#gl-sha-25
6060

6161
| Type | Example | Comments and Usage |
6262
| :--- | :--- | :--- |
63+
| Raw email address | `USER@example.com` | N/A |
6364
| Normalized email address | `user@example.com` | Normalization is always the first step. |
6465
| SHA-256 hash of normalized email address | `b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514` | This 64-character string is a hex-encoded representation of the 32-byte SHA-256. |
6566
| Hex to Base64 encoding of SHA-256 hash | `tMmiiTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ=` | This 44-character string is a Base64-encoded representation of the 32-byte SHA-256.<br/>WARNING: The SHA-256 hash string in the example above is a hex-encoded representation of the hash value. You must Base64-encode the raw bytes of the hash or use a Base64 encoder that takes a hex-encoded value as input.<br/>Use this encoding for `email_hash` values sent in the request body. |
@@ -70,6 +71,21 @@ When applying Base64 encoding, be sure to Base64-encode the raw bytes of the has
7071

7172
For additional examples, see [Normalization Examples for Email](#normalization-examples-for-email).
7273

74+
## Normalization Examples for Email
75+
76+
The following table shows examples of original email addresses and the normalized and hashed values.
77+
78+
Some of the examples show email addresses that include the plus sign (+), with different domains. For `gmail` addresses, the plus sign and following characters, up to the `@` sign, are ignored in normalization. For other domains, these characters are included in the normalized value.
79+
80+
| Original Value | Normalized | Hashed and Base64-Encoded |
81+
| :--- | :--- | :--- |
82+
| `MyEmail@example.com`<br/>`MYEMAIL@example.com` | `myemail@example.com` | Hashed: `16c18d336f0b250f0e2d907452ceb9658a74ecdae8bc94864c23122a72cc27a5`<br/>Base64-Encoded: `FsGNM28LJQ8OLZB0Us65ZYp07NrovJSGTCMSKnLMJ6U=` |
83+
| `My.Email@example.com` | `my.email@example.com` | Hashed: `e22b53bc6f871274f3a62ab37a3caed7214fc14d676215a96a242fcfada1c81f`<br/>Base64-Encoded: `4itTvG+HEnTzpiqzejyu1yFPwU1nYhWpaiQvz62hyB8=` |
84+
| `JANESAOIRSE@example.com`<br/>`JaneSaoirse@example.com` | `janesaoirse@example.com` | Hashed: `d6670e7a92007f1b5ff785f1fc81e53aa6d3d7bd06bdf5c473cdc7286c284b6d`<br/>Base64-Encoded: `1mcOepIAfxtf94Xx/IHlOqbT170GvfXEc83HKGwoS20=` |
85+
| `jane.saoirse@example.com`<br/>`Jane.Saoirse@example.com` | `jane.saoirse@example.com` | Hashed: ` b196432c7b989a2ca91c83799957c515da53e6c13abf20b78fea94f117e90bf8`<br/>Base64-Encoded: `sZZDLHuYmiypHIN5mVfFFdpT5sE6vyC3j+qU8RfpC/g=` |
86+
| `JaneSaoirse+Work@example.com` | `janesaoirse+work@example.com` | Hashed: `28aaee4815230cd3b4ebd88c515226550666e91ac019929e3adac3f66c288180`<br/>Base64-Encoded: `KKruSBUjDNO069iMUVImVQZm6RrAGZKeOtrD9mwogYA=` |
87+
| `JANE.SAOIRSE@gmail.com`<br/>`Jane.Saoirse@gmail.com`<br/>`JaneSaoirse+Work@gmail.com` | `janesaoirse@gmail.com` | Hashed: `92ee26057ed9dea2535d6c8b141d48373932476599196e00352254896db5888f`<br/>Base64-Encoded: `ku4mBX7Z3qJTXWyLFB1INzkyR2WZGW4ANSJUiW21iI8=` |
88+
7389
## Phone Number Normalization
7490

7591
:::important
@@ -99,6 +115,7 @@ The following table shows an example of a simple input phone number, and the res
99115

100116
| Type | Example | Comments and Usage |
101117
| :--- | :--- | :--- |
118+
| Raw phone number | `1 (234) 567-8901` | N/A |
102119
| Normalized phone number | `+12345678901` | Normalization is always the first step. |
103120
| SHA-256 hash of normalized phone number | `10e6f0b47054a83359477dcb35231db6de5c69fb1816e1a6b98e192de9e5b9ee` |This 64-character string is a hex-encoded representation of the 32-byte SHA-256. |
104121
| Hex to Base64 encoding of SHA-256 hash | `EObwtHBUqDNZR33LNSMdtt5cafsYFuGmuY4ZLenlue4=` | This 44-character string is a Base64-encoded representation of the 32-byte SHA-256.<br/>NOTE: The SHA-256 hash is a hexadecimal value. You must use a Base64 encoder that takes a hex value as input. Use this encoding for `phone_hash` values sent in the request body. |
@@ -107,21 +124,6 @@ The following table shows an example of a simple input phone number, and the res
107124
When applying Base64 encoding, be sure to use a function that takes a hex value as input. If you use a function that takes text as input, the result is a longer string which is invalid for the purposes of UID2.
108125
:::
109126

110-
## Normalization Examples for Email
111-
112-
The following table shows examples of original email addresses and the normalized and hashed values.
113-
114-
Some of the examples show email addresses that include the plus sign (+), with different domains. For `gmail` addresses, the plus sign and following characters, up to the `@` sign, are ignored in normalization. For other domains, these characters are included in the normalized value.
115-
116-
| Original Value | Normalized | Hashed and Base64-Encoded |
117-
| :--- | :--- | :--- |
118-
| `MyEmail@example.com`<br/>`MYEMAIL@example.com` | `myemail@example.com` | Hashed: `16c18d336f0b250f0e2d907452ceb9658a74ecdae8bc94864c23122a72cc27a5`<br/>Base64-Encoded: `FsGNM28LJQ8OLZB0Us65ZYp07NrovJSGTCMSKnLMJ6U=` |
119-
| `My.Email@example.com` | `my.email@example.com` | Hashed: `e22b53bc6f871274f3a62ab37a3caed7214fc14d676215a96a242fcfada1c81f`<br/>Base64-Encoded: `4itTvG+HEnTzpiqzejyu1yFPwU1nYhWpaiQvz62hyB8=` |
120-
| `JANESAOIRSE@example.com`<br/>`JaneSaoirse@example.com` | `janesaoirse@example.com` | Hashed: `d6670e7a92007f1b5ff785f1fc81e53aa6d3d7bd06bdf5c473cdc7286c284b6d`<br/>Base64-Encoded: `1mcOepIAfxtf94Xx/IHlOqbT170GvfXEc83HKGwoS20=` |
121-
| `jane.saoirse@example.com`<br/>`Jane.Saoirse@example.com` | `jane.saoirse@example.com` | Hashed: ` b196432c7b989a2ca91c83799957c515da53e6c13abf20b78fea94f117e90bf8`<br/>Base64-Encoded: `sZZDLHuYmiypHIN5mVfFFdpT5sE6vyC3j+qU8RfpC/g=` |
122-
| `JaneSaoirse+Work@example.com` | `janesaoirse+work@example.com` | Hashed: `28aaee4815230cd3b4ebd88c515226550666e91ac019929e3adac3f66c288180`<br/>Base64-Encoded: `KKruSBUjDNO069iMUVImVQZm6RrAGZKeOtrD9mwogYA=` |
123-
| `JANE.SAOIRSE@gmail.com`<br/>`Jane.Saoirse@gmail.com`<br/>`JaneSaoirse+Work@gmail.com` | `janesaoirse@gmail.com` | Hashed: `92ee26057ed9dea2535d6c8b141d48373932476599196e00352254896db5888f`<br/>Base64-Encoded: `ku4mBX7Z3qJTXWyLFB1INzkyR2WZGW4ANSJUiW21iI8=` |
124-
125127
## Example Code
126128

127129
For an example of how to generate email and phone hashes in JavaScript, see [Example Code: Hashing and Base-64 Encoding](../guides/integration-javascript-client-side#example-code-hashing-and-base-64-encoding).

0 commit comments

Comments
 (0)