From 33ea23efb1abe89d527b3561abe3fca9d9f2bea1 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 1 Jul 2025 11:49:37 -0600 Subject: [PATCH 1/7] add better disclaimers across all readmes and example sites --- examples/cstg/html/index.html | 7 +++++-- .../client_side/README.md | 4 ++-- .../client_side/views/index.html | 7 +++++-- .../react_client_side/README.md | 4 ++-- .../server_side/README.md | 14 +++++++------- .../with_sdk_v3/README.md | 4 ++-- .../with_sdk_v3/views/login.html | 2 +- examples/js-sdk/README.md | 18 +++++++++--------- examples/js-sdk/views/index.html | 7 ++++++- examples/js-sdk/views/login.html | 2 +- 10 files changed, 40 insertions(+), 29 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index 3462f307..788bcb65 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -96,6 +96,9 @@

UID2 Publisher Client-Side Integration Example using UID2 JavaScript SDK

Client-Side Integration Guide for JavaScript to implement UID2 integration and generate UID2 tokens. + Note: This is a test-only integration environment—not for production + use. It does not perform real user authentication or generate production-level tokens. Do not + connect this site to real user traffic.

@@ -134,11 +137,11 @@

UID2 Publisher Client-Side Integration Example using UID2 JavaScript SDK

-
>
+
>
diff --git a/examples/google-secure-signals-integration/client_side/README.md b/examples/google-secure-signals-integration/client_side/README.md index 6b60c3f5..9179a279 100644 --- a/examples/google-secure-signals-integration/client_side/README.md +++ b/examples/google-secure-signals-integration/client_side/README.md @@ -24,10 +24,10 @@ The following table outlines and annotates the steps you may take to test and ex | Step | Description | Comments | | :--: | :---------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main [page](views/index.html) of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Log In**. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JS SDK ([Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript)). | +| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Submit**. (Note: The button is labeled "Submit" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Login", not "Submit".) | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JS SDK ([Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript)). | | 3 | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `client-generate` response. Next, the identity information is passed to the UID2 SDK [`setIdentity()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#setidentityidentity-identity-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party UID2 cookie (see [UID2 Storage Format](https://unifiedid.com/docs/sdks/sdk-ref-javascript#uid2-storage-format) for use on subsequent page loads.) | | 4 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value and a video player. While the [page](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page](views/index.html) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie or local storage. | | 5 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | | 6 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | | 7 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | -| 8 | To exit the application, click **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user identity is valid and refreshable. | +| 8 | To exit the application, click **Clear UID2**. (Note: The button is labeled "Clear UID2" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Logout", not "Clear UID2".) | This event calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/examples/google-secure-signals-integration/client_side/views/index.html b/examples/google-secure-signals-integration/client_side/views/index.html index 87792352..1944b6fa 100644 --- a/examples/google-secure-signals-integration/client_side/views/index.html +++ b/examples/google-secure-signals-integration/client_side/views/index.html @@ -18,6 +18,9 @@

UID2 Publisher Client-Side Integration Example using UID2 JavaScript SDK, Se Client-Side Integration Guide for JavaScript to implement UID2 integration and generate UID2 tokens. Secure Signals is updated when the page is reloaded. Reload the page in order to update Secure Signals in local storage. + Note: This is a test-only integration environment—not for production use. + It does not perform real user authentication or generate production-level tokens. + Do not connect this site to real user traffic.

@@ -71,11 +74,11 @@

UID2 Publisher Client-Side Integration Example using UID2 JavaScript SDK, Se value="validate@example.com" />

-
>
+
diff --git a/examples/google-secure-signals-integration/react_client_side/README.md b/examples/google-secure-signals-integration/react_client_side/README.md index 884f81ca..1ccc2e8e 100644 --- a/examples/google-secure-signals-integration/react_client_side/README.md +++ b/examples/google-secure-signals-integration/react_client_side/README.md @@ -24,10 +24,10 @@ The following table outlines and annotates the steps you may take to test and ex | Step | Description | Comments | | :--: | :---------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main [page](src/SecureSignalsApp.tsx) of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Log In**. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JS SDK ([Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript)). | +| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Submit**. (Note: The button is labeled "Submit" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Login", not "Submit".) | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JS SDK ([Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript)). | | 3 | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `client-generate` response. Next, the identity information is passed to the UID2 SDK [`setIdentity()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#setidentityidentity-identity-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party UID2 cookie (see [UID2 Storage Format](https://unifiedid.com/docs/sdks/sdk-ref-javascript#uid2-storage-format) for use on subsequent page loads.) | | 4 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value and a video player. While the [page](src/SecureSignalsApp.tsx) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page](src/SecureSignalsApp.tsx) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie or local storage. | | 5 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | | 6 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | | 7 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | -| 8 | To exit the application, click **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user identity is valid and refreshable. | +| 8 | To exit the application, click **Clear UID2**. (Note: The button is labeled "Clear UID2" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Logout", not "Clear UID2".) | This event calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/examples/google-secure-signals-integration/server_side/README.md b/examples/google-secure-signals-integration/server_side/README.md index b92dd858..2bc7f7ba 100644 --- a/examples/google-secure-signals-integration/server_side/README.md +++ b/examples/google-secure-signals-integration/server_side/README.md @@ -58,10 +58,10 @@ step is omitted, and the login process focuses on integration with the UID2 serv The following table outlines and annotates the steps you can take to test and explore the example application. -| Step | Description | Comments | -| :--: | :--------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | -| 2 | Enter the email address that you want to use for testing and click **Log In**. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | -| | The main page updates to display the established UID2 identity information and a video player. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the successful `POST /token/generate` response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. While the main page is loading, [Google Publisher Tag (GPT)](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage. The [Interactive Media Ads (IMA) SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) then makes an ad request, and transmits the encoded signal in the request. | -| 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll.ad. | -| 5 | To exit the application, click **Log Out**. | This calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals, and then calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the UID2 session and the first-party cookie and presents the user with the login form again.
NOTE: As long as the user is logged in, the page displays the **Log Out** button. | +| Step | Description | Comments | +| :--: | :------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | +| 2 | Enter the email address that you want to use for testing and click **Submit**. (Note: The button is labeled "Submit" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Login", not "Submit".) | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | +| | The main page updates to display the established UID2 identity information and a video player. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the successful `POST /token/generate` response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. While the main page is loading, [Google Publisher Tag (GPT)](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage. The [Interactive Media Ads (IMA) SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) then makes an ad request, and transmits the encoded signal in the request. | +| 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll.ad. | +| 5 | To exit the application, click **Clear UID2**. (Note: The button is labeled "Clear UID2" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Logout", not "Clear UID2".) | This event calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals, and then calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the UID2 session and the first-party cookie and presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/examples/google-secure-signals-integration/with_sdk_v3/README.md b/examples/google-secure-signals-integration/with_sdk_v3/README.md index e1c02255..5e2e27e2 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/README.md +++ b/examples/google-secure-signals-integration/with_sdk_v3/README.md @@ -68,9 +68,9 @@ The following table outlines and annotates the steps you can take to test and ex | Step | Description | Comments | | :--: | :------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the email address that you want to use for testing and click **Log In**. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) endpoint and processes the received response. | +| 2 | In the text field at the bottom, enter the email address that you want to use for testing and click **Submit**. (Note: The button is labeled "Submit" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Login", not "Submit".) | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) endpoint and processes the received response. | | | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `POST /token/generate` response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the UID2 SDK [`init()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party UID2 cookie (see [UID2 Storage Format](https://unifiedid.com/docs/sdks/sdk-ref-javascript#uid2-storage-format) for use on subsequent page loads. | | 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value and a video player. While the [page view](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page view](views/index.html) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | | 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | | 5 | Keep the application main page open, or refresh it after a while, and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up to date, and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked, and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow Overview](https://unifiedid.com/docs/sdks/sdk-ref-javascript#workflow-overview) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/sdk-ref-javascript#background-token-auto-refresh). | -| 6 | To exit the application, click **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user identity is valid and refreshable. | +| 6 | To exit the application, click **Clear UID2**. (Note: The button is labeled "Clear UID2" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Logout", not "Clear UID2".) | This event calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/examples/google-secure-signals-integration/with_sdk_v3/views/login.html b/examples/google-secure-signals-integration/with_sdk_v3/views/login.html index 2baf7825..4116a997 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/views/login.html +++ b/examples/google-secure-signals-integration/with_sdk_v3/views/login.html @@ -25,7 +25,7 @@ <%- include('intro.html'); -%> -

Login completed

+

Submission completed

UID2 identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

diff --git a/examples/js-sdk/README.md b/examples/js-sdk/README.md index 743d70cb..78d43713 100644 --- a/examples/js-sdk/README.md +++ b/examples/js-sdk/README.md @@ -52,12 +52,12 @@ The example application illustrates the steps documented in the [UID2 SDK Integr The following table outlines and annotates the steps you may take to test and explore the example application. -| Step | Description | Comments | -| :--: | :---------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Log In**. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | -| | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `POST /token/generate` response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the [UID2 SDK `init()` function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void). If the identity is valid, the SDK stores it in a [first-party UID2 cookie](https://unifiedid.com/docs/sdks/client-side-identity#uid2-cookie-format) for use on subsequent page loads. | -| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value. The [page view](views/index.html) calls the [init() function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void) again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | -| 4 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | -| 5 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | -| 6 | To exit the application, click **Log Out**. | This calls the [UID2 SDK `disconnect()` function](https://unifiedid.com/docs/sdks/client-side-identity#disconnect-void), which clears the UID2 session and the first-party cookie. This call also makes the [UID2 SDK `isLoginRequired()` function](https://unifiedid.com/docs/sdks/client-side-identity#isloginrequired-boolean) return `true`, which presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user identity is valid and refreshable. | +| Step | Description | Comments | +| :--: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Submit**. (Note: The button is labeled "Submit" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Login", not "Submit".) | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | +| | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `POST /token/generate` response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the [UID2 SDK `init()` function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void). If the identity is valid, the SDK stores it in a [first-party UID2 cookie](https://unifiedid.com/docs/sdks/client-side-identity#uid2-cookie-format) for use on subsequent page loads. | +| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value. The [page view](views/index.html) calls the [init() function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void) again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | +| 4 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | +| 5 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | +| 6 | To exit the application, click **Clear UID2**. (Note: The button is labeled "Clear UID2" here to ensure differentiation of testing environments; in a real production environment, users would see a button labeled "Logout", not "Clear UID2".) | This event calls the [UID2 SDK `disconnect()` function](https://unifiedid.com/docs/sdks/client-side-identity#disconnect-void), which clears the UID2 session and the first-party cookie. This call also makes the [UID2 SDK `isLoginRequired()` function](https://unifiedid.com/docs/sdks/client-side-identity#isloginrequired-boolean) return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/examples/js-sdk/views/index.html b/examples/js-sdk/views/index.html index 242c5a35..2dd63ed8 100644 --- a/examples/js-sdk/views/index.html +++ b/examples/js-sdk/views/index.html @@ -49,6 +49,11 @@ <%- include('intro.html'); -%> +

+ Note: This is a test-only integration environment—not for production + use. It does not perform real user authentication or generate production-level tokens. Do not + connect this site to real user traffic. +

@@ -87,7 +92,7 @@ diff --git a/examples/js-sdk/views/login.html b/examples/js-sdk/views/login.html index b1d0f704..4da16d2f 100644 --- a/examples/js-sdk/views/login.html +++ b/examples/js-sdk/views/login.html @@ -20,7 +20,7 @@ <%- include('intro.html'); -%> -

Login completed

+

Submission completed

UID2 identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

From 05ff19a0d6c15eb664ec846f1ba2d1dd6d1c0fcf Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 1 Jul 2025 13:03:23 -0600 Subject: [PATCH 2/7] switched button names and removed redundant disclaimer --- examples/cstg/html/index.html | 2 +- .../client_side/README.md | 20 +++++++++---------- .../client_side/views/index.html | 2 +- .../react_client_side/README.md | 20 +++++++++---------- .../server_side/README.md | 14 ++++++------- .../with_sdk_v3/README.md | 18 ++++++++--------- .../with_sdk_v3/views/index.html | 2 +- .../with_sdk_v3/views/login.html | 4 ++-- examples/js-sdk/README.md | 18 ++++++++--------- examples/js-sdk/views/index.html | 2 +- examples/js-sdk/views/login.html | 4 ++-- 11 files changed, 53 insertions(+), 53 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index 788bcb65..d7394ae9 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -137,7 +137,7 @@

UID2 Publisher Client-Side Integration Example using UID2 JavaScript SDK

-
>
+
>
-
+
-
+
-
+
diff --git a/examples/google-secure-signals-integration/server_side/views/login.html b/examples/google-secure-signals-integration/server_side/views/login.html index 8ce6da6a..056f0791 100644 --- a/examples/google-secure-signals-integration/server_side/views/login.html +++ b/examples/google-secure-signals-integration/server_side/views/login.html @@ -9,7 +9,7 @@ style="border-style: none" /> -
+
<%- include('intro.html'); -%> +

+ Note: This is a test-only integration environment—not for production + use. It does not perform real user authentication or generate production-level tokens. Do not + use real user data on this page. +

Ready for Targeted Advertising:
@@ -120,7 +125,7 @@ diff --git a/examples/js-sdk/views/index.html b/examples/js-sdk/views/index.html index aa3e77a7..d34fa534 100644 --- a/examples/js-sdk/views/index.html +++ b/examples/js-sdk/views/index.html @@ -52,7 +52,7 @@

Note: This is a test-only integration environment—not for production use. It does not perform real user authentication or generate production-level tokens. Do not - connect this site to real user traffic. + use real user data on this page.

Ready for Targeted Advertising:
From 753429e11223e91c3b7d34f40e561b458a6ca57a Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 1 Jul 2025 16:14:30 -0600 Subject: [PATCH 7/7] update securesignalsapp labels + check readme --- .../react_client_side/src/SecureSignalsApp.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/google-secure-signals-integration/react_client_side/src/SecureSignalsApp.tsx b/examples/google-secure-signals-integration/react_client_side/src/SecureSignalsApp.tsx index e41ec5f2..9518d7a8 100644 --- a/examples/google-secure-signals-integration/react_client_side/src/SecureSignalsApp.tsx +++ b/examples/google-secure-signals-integration/react_client_side/src/SecureSignalsApp.tsx @@ -383,7 +383,7 @@ const SecureSignalsApp = () => {
@@ -391,7 +391,7 @@ const SecureSignalsApp = () => {