From 6bc7d4472e416d5182f7f792b77bc780435becd1 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 5 Dec 2024 20:21:15 -0700 Subject: [PATCH 1/5] replace isloginrequired with no identity available function --- examples/cstg/html/index.html | 13 ++++++------- .../with_sdk_v3/README.md | 2 +- .../with_sdk_v3/views/index.html | 4 ++-- .../with_sdk_v3/views/login.html | 4 ++-- setupJest.js | 16 ++++++++-------- src/sdkBase.ts | 15 ++++++++++----- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index b04c95e9..eec1519c 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -27,11 +27,9 @@ $('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no'); $('#advertising_token').text(String(sdk.getAdvertisingToken())); $('#login_required').text( - sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no' - ); - $(`#has_opted_out`).text( - sdk.hasOptedOut() ? 'yes' : 'no' + sdk.noIdentityAvailable() || sdk.noIdentityAvailable() === undefined ? 'yes' : 'no' ); + $(`#has_opted_out`).text(sdk.hasOptedOut() ? 'yes' : 'no'); $('#update_counter').text(callbackCounter); $('#identity_state').text(String(JSON.stringify(state, null, 2))); @@ -39,7 +37,7 @@ } function updateSharedGuiElements() { - if (getUidSdk().isLoginRequired()) { + if (getUidSdk().noIdentityAvailable()) { $('#login_form').show(); $('#logout_form').hide(); } else { @@ -65,10 +63,11 @@ }); $('#login').click(async () => { - const email = $('#email').val(); + //const email = $('#email').val(); + const phone = $('#email').val(); try { - await getUidSdk().setIdentityFromEmail(email, clientSideIdentityOptions); + await getUidSdk().setIdentityFromPhoneHash(phone, clientSideIdentityOptions); } catch (e) { console.error('setIdentityFromEmail failed', e); } 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 52da94b2..68350beb 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/README.md +++ b/examples/google-secure-signals-integration/with_sdk_v3/README.md @@ -73,4 +73,4 @@ The following table outlines and annotates the steps you can take to test and ex | 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/client-side-identity#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/client-side-identity#workflow-overview) 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()`](https://unifiedid.com/docs/sdks/client-side-identity#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/client-side-identity#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 **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/client-side-identity#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 [`noIdentityAvailable()`](https://unifiedid.com/docs/sdks/client-side-identity#noIdentityAvailable-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. | diff --git a/examples/google-secure-signals-integration/with_sdk_v3/views/index.html b/examples/google-secure-signals-integration/with_sdk_v3/views/index.html index 8b969a4d..0d2152e5 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/views/index.html +++ b/examples/google-secure-signals-integration/with_sdk_v3/views/index.html @@ -17,11 +17,11 @@ __uid2.getAdvertisingToken() ? "yes" : "no" ); $("#advertising_token").html(String(__uid2.getAdvertisingToken())); - $("#login_required").html(__uid2.isLoginRequired() ? "yes" : "no"); + $("#login_required").html(__uid2.noIdentityAvailable() ? "yes" : "no"); $("#update_counter").html(callbackCounter); $("#identity_state").html(String(JSON.stringify(payload, null, 2))); - if (__uid2.isLoginRequired()) { + if (__uid2.noIdentityAvailable()) { $("#login_form").show(); $("#logout_form").hide(); $('#googleAdContainer').hide(); 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 05181322..bdd5d523 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 @@ -1,4 +1,4 @@ - + @@ -18,7 +18,7 @@ }); } if (eventType === 'InitCompleted') { - if (__uid2.isLoginRequired()) __uid2.setIdentity(<%- JSON.stringify(identity) %>) + if (__uid2.noIdentityAvailable()) __uid2.setIdentity(<%- JSON.stringify(identity) %>) } }); diff --git a/setupJest.js b/setupJest.js index 347db21f..ff894906 100644 --- a/setupJest.js +++ b/setupJest.js @@ -17,47 +17,47 @@ expect.extend({ expect(uid2.getAdvertisingToken()).toBeNonEmptyString(); } - expect(uid2.isLoginRequired()).toEqual(false); + expect(uid2.noIdentityAvailable()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns a token and isLoginRequired() returns false', + 'Expected getAdvertisingToken() returns a token and noIdentityAvailable() returns false', }; }, toBeInTemporarilyUnavailableState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.isLoginRequired()).toEqual(false); + expect(uid2.noIdentityAvailable()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns false', + 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns false', }; }, toBeInUnavailableState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.isLoginRequired()).toEqual(true); + expect(uid2.noIdentityAvailable()).toEqual(true); expect(uid2.hasOptedOut()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns true', + 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns true', }; }, toBeInOptoutState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.isLoginRequired()).toEqual(false); + expect(uid2.noIdentityAvailable()).toEqual(false); expect(uid2.hasOptedOut()).toEqual(true); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns false', + 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns false', }; }, }); diff --git a/src/sdkBase.ts b/src/sdkBase.ts index b402916a..2f4c49a6 100644 --- a/src/sdkBase.ts +++ b/src/sdkBase.ts @@ -182,17 +182,22 @@ export abstract class SdkBase { } /** - * Deprecated + * @deprecated in version 3.9.0. Use noIdentityAvailable() instead */ - public isLoginRequired() { - return this.hasIdentity(); + public noIdentityAvailable() { + return this.noIdentityAvailable(); } - public hasIdentity() { + public noIdentityAvailable() { if (!this._initComplete) return undefined; return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests()); } + // public hasIdentity() { + // if (!this._initComplete) return undefined; + // return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests()); + // } + public hasOptedOut() { if (!this._initComplete) return undefined; return isOptoutIdentity(this._identity); @@ -439,7 +444,7 @@ export abstract class SdkBase { clearTimeout(this._refreshTimerId); } this._refreshTimerId = setTimeout(() => { - if (this.isLoginRequired()) return; + if (this.noIdentityAvailable()) return; const validatedIdentity = this.validateAndSetIdentity( this._storageManager?.loadIdentity() ?? null ); From 41209bf185ff372e8ef3f50c8b3cb5e5bd0359f3 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 5 Dec 2024 20:27:09 -0700 Subject: [PATCH 2/5] fixed changes --- examples/cstg/html/index.html | 9 ++++----- src/sdkBase.ts | 7 +------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index eec1519c..d248b473 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -27,7 +27,7 @@ $('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no'); $('#advertising_token').text(String(sdk.getAdvertisingToken())); $('#login_required').text( - sdk.noIdentityAvailable() || sdk.noIdentityAvailable() === undefined ? 'yes' : 'no' + sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no' ); $(`#has_opted_out`).text(sdk.hasOptedOut() ? 'yes' : 'no'); $('#update_counter').text(callbackCounter); @@ -37,7 +37,7 @@ } function updateSharedGuiElements() { - if (getUidSdk().noIdentityAvailable()) { + if (getUidSdk().isLoginRequired()) { $('#login_form').show(); $('#logout_form').hide(); } else { @@ -63,11 +63,10 @@ }); $('#login').click(async () => { - //const email = $('#email').val(); - const phone = $('#email').val(); + const email = $('#email').val(); try { - await getUidSdk().setIdentityFromPhoneHash(phone, clientSideIdentityOptions); + await getUidSdk().setIdentityFromEmail(email, clientSideIdentityOptions); } catch (e) { console.error('setIdentityFromEmail failed', e); } diff --git a/src/sdkBase.ts b/src/sdkBase.ts index 2f4c49a6..64b0c9ec 100644 --- a/src/sdkBase.ts +++ b/src/sdkBase.ts @@ -184,7 +184,7 @@ export abstract class SdkBase { /** * @deprecated in version 3.9.0. Use noIdentityAvailable() instead */ - public noIdentityAvailable() { + public isLoginRequired() { return this.noIdentityAvailable(); } @@ -193,11 +193,6 @@ export abstract class SdkBase { return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests()); } - // public hasIdentity() { - // if (!this._initComplete) return undefined; - // return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests()); - // } - public hasOptedOut() { if (!this._initComplete) return undefined; return isOptoutIdentity(this._identity); From c86dfb9ce42e67a90e4c50445b5747b50801b91c Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 5 Dec 2024 20:28:34 -0700 Subject: [PATCH 3/5] to no identity available --- examples/cstg/html/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index d248b473..658555f5 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -27,7 +27,7 @@ $('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no'); $('#advertising_token').text(String(sdk.getAdvertisingToken())); $('#login_required').text( - sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no' + sdk.noIdentityAvailable() || sdk.noIdentityAvailable() === undefined ? 'yes' : 'no' ); $(`#has_opted_out`).text(sdk.hasOptedOut() ? 'yes' : 'no'); $('#update_counter').text(callbackCounter); @@ -37,7 +37,7 @@ } function updateSharedGuiElements() { - if (getUidSdk().isLoginRequired()) { + if (getUidSdk().noIdentityAvailable()) { $('#login_form').show(); $('#logout_form').hide(); } else { From 4869277963ea71c6823464405739c248c7e04277 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 12 Dec 2024 13:41:49 -0700 Subject: [PATCH 4/5] created new is identity available function --- examples/cstg/html/index.html | 4 ++-- .../with_sdk_v3/README.md | 2 +- .../with_sdk_v3/views/index.html | 4 ++-- .../with_sdk_v3/views/login.html | 2 +- setupJest.js | 16 ++++++------- src/sdkBase.ts | 23 +++++++++++-------- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/examples/cstg/html/index.html b/examples/cstg/html/index.html index 658555f5..d248b473 100644 --- a/examples/cstg/html/index.html +++ b/examples/cstg/html/index.html @@ -27,7 +27,7 @@ $('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no'); $('#advertising_token').text(String(sdk.getAdvertisingToken())); $('#login_required').text( - sdk.noIdentityAvailable() || sdk.noIdentityAvailable() === undefined ? 'yes' : 'no' + sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no' ); $(`#has_opted_out`).text(sdk.hasOptedOut() ? 'yes' : 'no'); $('#update_counter').text(callbackCounter); @@ -37,7 +37,7 @@ } function updateSharedGuiElements() { - if (getUidSdk().noIdentityAvailable()) { + if (getUidSdk().isLoginRequired()) { $('#login_form').show(); $('#logout_form').hide(); } else { 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 68350beb..b0b97e08 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/README.md +++ b/examples/google-secure-signals-integration/with_sdk_v3/README.md @@ -73,4 +73,4 @@ The following table outlines and annotates the steps you can take to test and ex | 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/client-side-identity#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/client-side-identity#workflow-overview) 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()`](https://unifiedid.com/docs/sdks/client-side-identity#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 [`noIdentityAvailable()`](https://unifiedid.com/docs/sdks/client-side-identity#noIdentityAvailable-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 **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/client-side-identity#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/client-side-identity#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. | diff --git a/examples/google-secure-signals-integration/with_sdk_v3/views/index.html b/examples/google-secure-signals-integration/with_sdk_v3/views/index.html index 0d2152e5..8b969a4d 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/views/index.html +++ b/examples/google-secure-signals-integration/with_sdk_v3/views/index.html @@ -17,11 +17,11 @@ __uid2.getAdvertisingToken() ? "yes" : "no" ); $("#advertising_token").html(String(__uid2.getAdvertisingToken())); - $("#login_required").html(__uid2.noIdentityAvailable() ? "yes" : "no"); + $("#login_required").html(__uid2.isLoginRequired() ? "yes" : "no"); $("#update_counter").html(callbackCounter); $("#identity_state").html(String(JSON.stringify(payload, null, 2))); - if (__uid2.noIdentityAvailable()) { + if (__uid2.isLoginRequired()) { $("#login_form").show(); $("#logout_form").hide(); $('#googleAdContainer').hide(); 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 bdd5d523..b9c8ba37 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 @@ -18,7 +18,7 @@ }); } if (eventType === 'InitCompleted') { - if (__uid2.noIdentityAvailable()) __uid2.setIdentity(<%- JSON.stringify(identity) %>) + if (__uid2.isLoginRequired()) __uid2.setIdentity(<%- JSON.stringify(identity) %>) } }); diff --git a/setupJest.js b/setupJest.js index ff894906..347db21f 100644 --- a/setupJest.js +++ b/setupJest.js @@ -17,47 +17,47 @@ expect.extend({ expect(uid2.getAdvertisingToken()).toBeNonEmptyString(); } - expect(uid2.noIdentityAvailable()).toEqual(false); + expect(uid2.isLoginRequired()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns a token and noIdentityAvailable() returns false', + 'Expected getAdvertisingToken() returns a token and isLoginRequired() returns false', }; }, toBeInTemporarilyUnavailableState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.noIdentityAvailable()).toEqual(false); + expect(uid2.isLoginRequired()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns false', + 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns false', }; }, toBeInUnavailableState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.noIdentityAvailable()).toEqual(true); + expect(uid2.isLoginRequired()).toEqual(true); expect(uid2.hasOptedOut()).toEqual(false); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns true', + 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns true', }; }, toBeInOptoutState(uid2) { expect(uid2.getAdvertisingToken()).toBeUndefined(); - expect(uid2.noIdentityAvailable()).toEqual(false); + expect(uid2.isLoginRequired()).toEqual(false); expect(uid2.hasOptedOut()).toEqual(true); return { pass: true, message: () => - 'Expected getAdvertisingToken() returns undefined and noIdentityAvailable() returns false', + 'Expected getAdvertisingToken() returns undefined and isLoginRequired() returns false', }; }, }); diff --git a/src/sdkBase.ts b/src/sdkBase.ts index 64b0c9ec..5b880c31 100644 --- a/src/sdkBase.ts +++ b/src/sdkBase.ts @@ -181,16 +181,20 @@ export abstract class SdkBase { return this._initComplete; } - /** - * @deprecated in version 3.9.0. Use noIdentityAvailable() instead - */ public isLoginRequired() { - return this.noIdentityAvailable(); + return !this.isIdentityAvailable(); } - public noIdentityAvailable() { + /** + * @deprecated in version 3.10.0. Will remove in June 2025. Use isIdentityAvailable() instead. + **/ + public hasIdentity() { if (!this._initComplete) return undefined; - return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests()); + return !(this.isIdentityValid() || this._apiClient?.hasActiveRequests()); + } + + public isIdentityAvailable() { + return this.isIdentityValid() || this._apiClient?.hasActiveRequests(); } public hasOptedOut() { @@ -295,8 +299,9 @@ export abstract class SdkBase { if (this.hasOptedOut()) this._callbackManager.runCallbacks(EventType.OptoutReceived, {}); } - private isLoggedIn() { - return this._identity && !hasExpired(this._identity.refresh_expires); + private isIdentityValid() { + const identity = this._identity ?? this.getIdentityNoInit(); + return identity && !hasExpired(identity.refresh_expires); } private temporarilyUnavailable(identity: Identity | OptoutIdentity | null | undefined) { @@ -439,7 +444,7 @@ export abstract class SdkBase { clearTimeout(this._refreshTimerId); } this._refreshTimerId = setTimeout(() => { - if (this.noIdentityAvailable()) return; + if (this.isLoginRequired()) return; const validatedIdentity = this.validateAndSetIdentity( this._storageManager?.loadIdentity() ?? null ); From 5c7e4209137b93f9329d99c7a9c46980970e8f16 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 12 Dec 2024 13:44:11 -0700 Subject: [PATCH 5/5] fix readme link --- .../google-secure-signals-integration/with_sdk_v3/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b0b97e08..52da94b2 100644 --- a/examples/google-secure-signals-integration/with_sdk_v3/README.md +++ b/examples/google-secure-signals-integration/with_sdk_v3/README.md @@ -73,4 +73,4 @@ The following table outlines and annotates the steps you can take to test and ex | 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/client-side-identity#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/client-side-identity#workflow-overview) 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()`](https://unifiedid.com/docs/sdks/client-side-identity#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/client-side-identity#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 **Log Out**. | This calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/client-side-identity#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/client-side-identity#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. |