From c62bbecd833fd5638c25dd36e06263210eef4cb9 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Fri, 6 Mar 2026 17:23:44 -0700 Subject: [PATCH 1/9] add disclaimer note to all smaple pages and hashing tool --- tools/hashing-tool/app.css | 8 ++++++++ tools/hashing-tool/index.html | 3 ++- .../client-server/views/index.html | 1 + .../google-secure-signals/client-side/html/index.html | 1 + .../react-client-side/src/SecureSignalsApp.tsx | 1 + .../server-side/views/index.html | 1 + .../client-server/public/stylesheets/app.css | 10 +++++++++- .../javascript-sdk/client-server/views/index.html | 1 + .../javascript-sdk/client-side/html/index.html | 3 ++- .../client-side/html/stylesheets/app.css | 11 +++++++---- .../react-client-side/src/ClientSideApp.tsx | 2 ++ .../react-client-side/src/styles/app.css | 10 +++++++++- .../client-server/public/index.html | 1 + .../client-side-deferred/index.html | 1 + .../prebid-integrations/client-side/index.html | 1 + .../prebid-secure-signals/client-side/index.html | 1 + web-integrations/server-side/views/index.html | 1 + 17 files changed, 49 insertions(+), 8 deletions(-) diff --git a/tools/hashing-tool/app.css b/tools/hashing-tool/app.css index 7bb903a5..daeed59f 100644 --- a/tools/hashing-tool/app.css +++ b/tools/hashing-tool/app.css @@ -154,6 +154,14 @@ h2 { line-height: 1.8; } +/* Section summary - test environment note */ +p.section-summary { + font-size: 0.95rem; + color: var(--text-gray); + margin-bottom: 1rem; + line-height: 1.8; +} + a { color: var(--link-color); text-decoration: underline; diff --git a/tools/hashing-tool/index.html b/tools/hashing-tool/index.html index 419e2171..0e824610 100644 --- a/tools/hashing-tool/index.html +++ b/tools/hashing-tool/index.html @@ -162,7 +162,8 @@

${IDENTITY_NAME} Hashing Tool

Results

- +

Note: This is a test-only environment—no data is collected. Use test values only.

+ - + - +
diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 3583adb2..00331037 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -160,6 +160,7 @@

<%- identityName %> Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/google-secure-signals/client-side/html/index.html b/web-integrations/google-secure-signals/client-side/html/index.html index 31f06fe1..f76c889d 100644 --- a/web-integrations/google-secure-signals/client-side/html/index.html +++ b/web-integrations/google-secure-signals/client-side/html/index.html @@ -35,6 +35,7 @@

Client-Side ${IDENTITY_NAME} Integration with Google Secure Signals

${IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx index 24bae32c..728af945 100644 --- a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx +++ b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx @@ -430,6 +430,7 @@ const SecureSignalsApp = () => { {/* UID2 Integration Status Section */}

{IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/google-secure-signals/server-side/views/index.html b/web-integrations/google-secure-signals/server-side/views/index.html index a9a3e561..8460f4ef 100644 --- a/web-integrations/google-secure-signals/server-side/views/index.html +++ b/web-integrations/google-secure-signals/server-side/views/index.html @@ -107,6 +107,7 @@

Server-Side <%- identityName %> Integration Example with Google Secure Signa

<%- identityName %> Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css b/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css index 4daeb56e..e45277be 100644 --- a/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css +++ b/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css @@ -135,6 +135,14 @@ p { line-height: 1.8; } +/* Section summary - matches other sample sites */ +p.section-summary { + font-size: 0.95rem; + color: var(--text-gray); + margin-bottom: 1rem; + line-height: 1.8; +} + a { color: var(--link-color); text-decoration: underline; @@ -150,7 +158,7 @@ a:hover { #uid_state { width: 100%; border-collapse: collapse; - margin: 2rem 0; + margin: 0 0 2rem 0; font-size: 0.875rem; border: 1px solid var(--border-color); border-radius: 8px; diff --git a/web-integrations/javascript-sdk/client-server/views/index.html b/web-integrations/javascript-sdk/client-server/views/index.html index e6c30d88..61cd6c2d 100644 --- a/web-integrations/javascript-sdk/client-server/views/index.html +++ b/web-integrations/javascript-sdk/client-server/views/index.html @@ -96,6 +96,7 @@

<%- identityName %> Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/javascript-sdk/client-side/html/index.html b/web-integrations/javascript-sdk/client-side/html/index.html index d3d96221..401c3bc3 100644 --- a/web-integrations/javascript-sdk/client-side/html/index.html +++ b/web-integrations/javascript-sdk/client-side/html/index.html @@ -3,7 +3,7 @@ Client-Side ${IDENTITY_NAME} Integration Example using JavaScript SDK - + @@ -106,6 +106,7 @@

Client-Side ${IDENTITY_NAME} Integration Example using JavaScript SDK

${IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css index 8df0b9c1..22690e76 100644 --- a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css +++ b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css @@ -56,11 +56,14 @@ body { gap: 2rem; max-width: 1400px; margin: 0 auto; + min-height: calc(100vh - 4rem); } /* Main Content Area (75%) */ .main-content { flex: 3; + display: flex; + flex-direction: column; background: var(--bg-white); border-radius: 12px; padding: 2.5rem; @@ -150,7 +153,7 @@ p { line-height: 1.8; } -/* Section summary - same styling as intro but gray */ +/* Section summary - matches Prebid */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); @@ -169,11 +172,11 @@ a:hover { opacity: 0.8; } -/* State Table */ +/* State Table - 0 top so gap = section-summary's 1rem only (Prebid collapses; we have overflow:hidden) */ #uid_state { width: 100%; border-collapse: collapse; - margin: 2rem 0; + margin: 0 0 2rem 0; font-size: 0.875rem; border: 1px solid var(--border-color); border-radius: 8px; @@ -351,7 +354,7 @@ a:hover { color: white; padding: 10px; border-radius: 4px; - font-size: 0.75rem; + font-size: 0.7rem; line-height: 1.125; min-width: 300px; max-width: 570px; diff --git a/web-integrations/javascript-sdk/react-client-side/src/ClientSideApp.tsx b/web-integrations/javascript-sdk/react-client-side/src/ClientSideApp.tsx index 3461fcaa..66d2dbd2 100644 --- a/web-integrations/javascript-sdk/react-client-side/src/ClientSideApp.tsx +++ b/web-integrations/javascript-sdk/react-client-side/src/ClientSideApp.tsx @@ -139,6 +139,8 @@ const ClientSideApp = () => { )}

{IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

+
diff --git a/web-integrations/javascript-sdk/react-client-side/src/styles/app.css b/web-integrations/javascript-sdk/react-client-side/src/styles/app.css index d24c7d94..649e8a77 100644 --- a/web-integrations/javascript-sdk/react-client-side/src/styles/app.css +++ b/web-integrations/javascript-sdk/react-client-side/src/styles/app.css @@ -150,6 +150,14 @@ p { line-height: 1.8; } +/* Section summary - matches other sample sites */ +p.section-summary { + font-size: 0.95rem; + color: var(--text-gray); + margin-bottom: 1rem; + line-height: 1.8; +} + a { color: var(--link-color); text-decoration: underline; @@ -165,7 +173,7 @@ a:hover { #uid_state { width: 100%; border-collapse: collapse; - margin: 2rem 0; + margin: 0 0 2rem 0; font-size: 0.875rem; border: 1px solid var(--border-color); border-radius: 8px; diff --git a/web-integrations/prebid-integrations/client-server/public/index.html b/web-integrations/prebid-integrations/client-server/public/index.html index 48a9195b..be0866a6 100644 --- a/web-integrations/prebid-integrations/client-server/public/index.html +++ b/web-integrations/prebid-integrations/client-server/public/index.html @@ -212,6 +212,7 @@

Client-Server <%- identityName %> SDK Integration Example with Prebid.js

<%- identityName %> Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/prebid-integrations/client-side-deferred/index.html b/web-integrations/prebid-integrations/client-side-deferred/index.html index 142e39eb..f1280156 100644 --- a/web-integrations/prebid-integrations/client-side-deferred/index.html +++ b/web-integrations/prebid-integrations/client-side-deferred/index.html @@ -270,6 +270,7 @@

📄 Initial Prebid Config (on page load)

${IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/prebid-integrations/client-side/index.html b/web-integrations/prebid-integrations/client-side/index.html index 895be0f9..8b63cdbb 100644 --- a/web-integrations/prebid-integrations/client-side/index.html +++ b/web-integrations/prebid-integrations/client-side/index.html @@ -234,6 +234,7 @@

Client-Side ${IDENTITY_NAME} Integration with Prebid.js

${IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/prebid-secure-signals/client-side/index.html b/web-integrations/prebid-secure-signals/client-side/index.html index b1067bab..47276221 100644 --- a/web-integrations/prebid-secure-signals/client-side/index.html +++ b/web-integrations/prebid-secure-signals/client-side/index.html @@ -324,6 +324,7 @@

Client-Side ${IDENTITY_NAME} Integration with Prebid.js (with Google Secure

${IDENTITY_NAME} Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

diff --git a/web-integrations/server-side/views/index.html b/web-integrations/server-side/views/index.html index 6e49ac9d..6952f9c4 100644 --- a/web-integrations/server-side/views/index.html +++ b/web-integrations/server-side/views/index.html @@ -54,6 +54,7 @@

Server-Side <%- identityName %> Integration Example

<% } %>

<%- identityName %> Integration Status

+

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

From 39442261a64ad0af905973d20f639fe4c7203c1f Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Fri, 6 Mar 2026 17:54:42 -0700 Subject: [PATCH 2/9] fix client server and serverside signals detection logic to match client side --- .../client-server/views/index.html | 24 +++++++++---------- .../client-side/html/index.html | 4 ++-- .../server-side/views/index.html | 20 +++++++--------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 00331037..51b6e6bb 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -25,8 +25,10 @@ $("#login_required").html(sdk.isLoginRequired() ? "yes" : "no"); $("#identity_state").html(String(JSON.stringify(payload, null, 2))); - // Update Secure Signals values displayed in the GUI updateSecureSignals(); + if (sdk.getAdvertisingToken()) { + setTimeout(updateSecureSignals, 1000); + } <% if (isOptout) { %> $("#login_form").hide(); @@ -35,7 +37,6 @@ $("#optout_banner").show(); $('#googleAdContainer').hide(); <% } else { %> - // before token generation, show login form if (sdk.isLoginRequired()) { $("#login_form").show(); $("#logout_form").hide(); @@ -43,7 +44,6 @@ $("#optout_banner").hide(); $('#googleAdContainer').hide(); } else { - // Success case - token generated, show logout form $("#login_form").hide(); $("#logout_form").show(); $("#optout_form").hide(); @@ -55,12 +55,14 @@ function updateSecureSignals() { try { - // Read from localStorage const secureSignalsStorageKey = '<%- secureSignalsStorageKey %>'; const secureSignalsStorage = localStorage[secureSignalsStorageKey]; - + const token = sdk.getAdvertisingToken(); + if (token && !secureSignalsStorage) { + location.reload(); + return; + } const secureSignalsStorageJson = secureSignalsStorage && JSON.parse(secureSignalsStorage); - if (secureSignalsStorageJson && secureSignalsStorageJson[1]) { $("#secure_signals_loaded").html("yes"); $("#secure_signals_value").html(JSON.stringify(secureSignalsStorageJson, null, 2)); @@ -83,12 +85,14 @@ $("#logout").click(() => { window.googletag.secureSignalProviders.clearAllCache(); sdk.disconnect(); + localStorage.removeItem('<%- secureSignalsStorageKey %>'); window.location.href = '/'; }); $("#try_another").click(() => { window.googletag.secureSignalProviders.clearAllCache(); sdk.disconnect(); + localStorage.removeItem('<%- secureSignalsStorageKey %>'); window.location.href = '/'; }); @@ -103,16 +107,12 @@ sdk.callbacks.push((eventType, payload) => { if (eventType === 'InitCompleted') { <% if (identity !== null && typeof identity !== 'undefined') { %> - // Server provided an identity, set it if (sdk.isLoginRequired()) { sdk.setIdentity(<%- JSON.stringify(identity) %>); } else { - // Identity already exists, just update GUI updateGuiElements(payload); } <% } else { %> - // No identity from server (including opt-out case) - // SDK will naturally remain in "login required" state updateGuiElements(payload); <% if (isOptout) { %> $("#optout_banner").show(); @@ -238,7 +238,7 @@

Google Secure Signals Status

-
+ - +
no
@@ -252,7 +252,7 @@

Google Secure Signals Status

undefined
diff --git a/web-integrations/google-secure-signals/client-side/html/index.html b/web-integrations/google-secure-signals/client-side/html/index.html index f76c889d..5dd238ea 100644 --- a/web-integrations/google-secure-signals/client-side/html/index.html +++ b/web-integrations/google-secure-signals/client-side/html/index.html @@ -127,7 +127,7 @@

Google Secure Signals Status

no
@@ -141,7 +141,7 @@

Google Secure Signals Status

undefined
diff --git a/web-integrations/google-secure-signals/server-side/views/index.html b/web-integrations/google-secure-signals/server-side/views/index.html index 8460f4ef..5d374870 100644 --- a/web-integrations/google-secure-signals/server-side/views/index.html +++ b/web-integrations/google-secure-signals/server-side/views/index.html @@ -7,24 +7,23 @@ - - - + + + + - From 8e691f712126334d57c7cd115daf0850b60828a3 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Fri, 6 Mar 2026 18:21:20 -0700 Subject: [PATCH 7/9] remove previous styling from testing --- .../javascript-sdk/client-side/html/stylesheets/app.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css index 037494f4..d481d5c9 100644 --- a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css +++ b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css @@ -56,14 +56,11 @@ body { gap: 2rem; max-width: 1400px; margin: 0 auto; - min-height: calc(100vh - 4rem); } /* Main Content Area (75%) */ .main-content { flex: 3; - display: flex; - flex-direction: column; background: var(--bg-white); border-radius: 12px; padding: 2.5rem; @@ -153,7 +150,6 @@ p { line-height: 1.8; } -/* Section summary - matches Prebid */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); From 507f00b9d78e68f6bca317c346cadddc183bbf23 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Mon, 9 Mar 2026 10:10:44 -0600 Subject: [PATCH 8/9] cleaning and restoring comments among files --- tools/hashing-tool/app.css | 2 +- .../google-secure-signals/client-server/server.js | 7 ++++--- .../client-server/public/stylesheets/app.css | 1 + .../javascript-sdk/client-side/html/stylesheets/app.css | 1 + .../javascript-sdk/react-client-side/src/styles/app.css | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/hashing-tool/app.css b/tools/hashing-tool/app.css index daeed59f..0e09e07d 100644 --- a/tools/hashing-tool/app.css +++ b/tools/hashing-tool/app.css @@ -154,7 +154,7 @@ h2 { line-height: 1.8; } -/* Section summary - test environment note */ +/* Section summary - same styling as intro but gray */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index 8623964b..ebf31979 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -19,6 +19,7 @@ const uidJsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; // Secure Signals configuration const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; +const secureSignalsStorageKey = process.env.UID_SECURE_SIGNALS_STORAGE_KEY || '_GESPSK-uidapi.com'; // UI/Display configuration const identityName = process.env.IDENTITY_NAME; @@ -48,7 +49,7 @@ app.get('/', (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, + secureSignalsStorageKey, identityName, docsBaseUrl }); @@ -147,7 +148,7 @@ app.post('/login', async (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, + secureSignalsStorageKey, identityName, docsBaseUrl }); @@ -173,7 +174,7 @@ app.post('/login', async (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, + secureSignalsStorageKey, identityName, docsBaseUrl }); diff --git a/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css b/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css index e5836be2..9b05adb0 100644 --- a/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css +++ b/web-integrations/javascript-sdk/client-server/public/stylesheets/app.css @@ -135,6 +135,7 @@ p { line-height: 1.8; } +/* Section summary - same styling as intro but gray */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); diff --git a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css index d481d5c9..f59d00e5 100644 --- a/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css +++ b/web-integrations/javascript-sdk/client-side/html/stylesheets/app.css @@ -150,6 +150,7 @@ p { line-height: 1.8; } +/* Section summary - same styling as intro but gray */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); diff --git a/web-integrations/javascript-sdk/react-client-side/src/styles/app.css b/web-integrations/javascript-sdk/react-client-side/src/styles/app.css index 9e5db114..fed0b66b 100644 --- a/web-integrations/javascript-sdk/react-client-side/src/styles/app.css +++ b/web-integrations/javascript-sdk/react-client-side/src/styles/app.css @@ -150,6 +150,7 @@ p { line-height: 1.8; } +/* Section summary - same styling as intro but gray */ p.section-summary { font-size: 0.95rem; color: var(--text-gray); From b2d9cd762c3da50f8f78f15c3e100bd542d1c991 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Mon, 9 Mar 2026 10:57:08 -0600 Subject: [PATCH 9/9] Revert Secure Signals UI detection changes (moved to separate PR) --- .../client-server/server.js | 7 +++--- .../client-server/views/index.html | 25 +++++++++---------- .../server-side/views/index.html | 18 +++++++------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index ebf31979..8623964b 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -19,7 +19,6 @@ const uidJsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; // Secure Signals configuration const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; -const secureSignalsStorageKey = process.env.UID_SECURE_SIGNALS_STORAGE_KEY || '_GESPSK-uidapi.com'; // UI/Display configuration const identityName = process.env.IDENTITY_NAME; @@ -49,7 +48,7 @@ app.get('/', (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); @@ -148,7 +147,7 @@ app.post('/login', async (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); @@ -174,7 +173,7 @@ app.post('/login', async (req, res) => { uidJsSdkUrl, uidJsSdkName, secureSignalsSdkUrl, - secureSignalsStorageKey, + secureSignalsStorageKey: process.env.UID_SECURE_SIGNALS_STORAGE_KEY, identityName, docsBaseUrl }); diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 51b6e6bb..3583adb2 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -25,10 +25,8 @@ $("#login_required").html(sdk.isLoginRequired() ? "yes" : "no"); $("#identity_state").html(String(JSON.stringify(payload, null, 2))); + // Update Secure Signals values displayed in the GUI updateSecureSignals(); - if (sdk.getAdvertisingToken()) { - setTimeout(updateSecureSignals, 1000); - } <% if (isOptout) { %> $("#login_form").hide(); @@ -37,6 +35,7 @@ $("#optout_banner").show(); $('#googleAdContainer').hide(); <% } else { %> + // before token generation, show login form if (sdk.isLoginRequired()) { $("#login_form").show(); $("#logout_form").hide(); @@ -44,6 +43,7 @@ $("#optout_banner").hide(); $('#googleAdContainer').hide(); } else { + // Success case - token generated, show logout form $("#login_form").hide(); $("#logout_form").show(); $("#optout_form").hide(); @@ -55,14 +55,12 @@ function updateSecureSignals() { try { + // Read from localStorage const secureSignalsStorageKey = '<%- secureSignalsStorageKey %>'; const secureSignalsStorage = localStorage[secureSignalsStorageKey]; - const token = sdk.getAdvertisingToken(); - if (token && !secureSignalsStorage) { - location.reload(); - return; - } + const secureSignalsStorageJson = secureSignalsStorage && JSON.parse(secureSignalsStorage); + if (secureSignalsStorageJson && secureSignalsStorageJson[1]) { $("#secure_signals_loaded").html("yes"); $("#secure_signals_value").html(JSON.stringify(secureSignalsStorageJson, null, 2)); @@ -85,14 +83,12 @@ $("#logout").click(() => { window.googletag.secureSignalProviders.clearAllCache(); sdk.disconnect(); - localStorage.removeItem('<%- secureSignalsStorageKey %>'); window.location.href = '/'; }); $("#try_another").click(() => { window.googletag.secureSignalProviders.clearAllCache(); sdk.disconnect(); - localStorage.removeItem('<%- secureSignalsStorageKey %>'); window.location.href = '/'; }); @@ -107,12 +103,16 @@ sdk.callbacks.push((eventType, payload) => { if (eventType === 'InitCompleted') { <% if (identity !== null && typeof identity !== 'undefined') { %> + // Server provided an identity, set it if (sdk.isLoginRequired()) { sdk.setIdentity(<%- JSON.stringify(identity) %>); } else { + // Identity already exists, just update GUI updateGuiElements(payload); } <% } else { %> + // No identity from server (including opt-out case) + // SDK will naturally remain in "login required" state updateGuiElements(payload); <% if (isOptout) { %> $("#optout_banner").show(); @@ -160,7 +160,6 @@

<%- identityName %> Integration Status

-

Note: This is a test-only integration environment—it does not collect data or generate production-level tokens.

@@ -238,7 +237,7 @@

Google Secure Signals Status

- + - +
no
@@ -252,7 +251,7 @@

Google Secure Signals Status

undefined
diff --git a/web-integrations/google-secure-signals/server-side/views/index.html b/web-integrations/google-secure-signals/server-side/views/index.html index db896a06..a9a3e561 100644 --- a/web-integrations/google-secure-signals/server-side/views/index.html +++ b/web-integrations/google-secure-signals/server-side/views/index.html @@ -7,22 +7,24 @@ + + + - - -