Skip to content

Commit 888561a

Browse files
update sidebar instructions and simplify styling
1 parent 748254f commit 888561a

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

web-integrations/prebid-integrations/client-side-deferred/app.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ a:hover {
356356
.merge-instructions {
357357
margin: 1rem 0 2rem 0;
358358
font-size: 0.9rem;
359+
line-height: 1.7;
359360
color: var(--text-gray);
360361
}
361362

@@ -370,7 +371,7 @@ a:hover {
370371
}
371372

372373
.merge-instructions li {
373-
margin-bottom: 0.25rem;
374+
margin-bottom: 0.5rem;
374375
}
375376

376377
.merge-instructions code {

web-integrations/prebid-integrations/client-side-deferred/index.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,7 @@ <h1>Deferred ${IDENTITY_NAME} Integration with Prebid.js</h1>
254254
<p class="intro">
255255
This example demonstrates how to integrate ${IDENTITY_NAME} with Prebid.js using <strong>deferred configuration</strong>.
256256
Unlike the standard integration where ${IDENTITY_NAME} is configured on page load, this pattern uses
257-
<code>mergeConfig()</code> and <code>refreshUserIds()</code> to add ${IDENTITY_NAME} <em>after</em> the page has loaded.
258-
This is useful for scenarios like async login, delayed consent, or Single Page Applications (SPAs).
257+
<code>mergeConfig()</code> and <code>refreshUserIds()</code> to add ${IDENTITY_NAME} <em>after</em> the page has loaded.
259258
[<a href="https://github.com/IABTechLab/uid2-examples/tree/main/web-integrations/prebid-integrations/client-side-deferred">Source Code</a>]
260259
</p>
261260

@@ -282,12 +281,12 @@ <h3>📄 Initial Prebid Config (on page load)</h3>
282281
<button type="button" class="button" id="clear_storage">Clear ${IDENTITY_NAME}</button>
283282
</div>
284283

285-
<!-- Instructions - simple, no box styling -->
284+
<!-- Instructions -->
286285
<div id="merge_instructions" class="merge-instructions">
287286
<p><strong>What happens when you click:</strong></p>
288287
<ol>
289-
<li><code>pbjs.mergeConfig(uidConfig)</code> - Adds ${IDENTITY_NAME} module to existing Prebid config</li>
290-
<li><code>pbjs.refreshUserIds()</code> - Triggers ${IDENTITY_NAME} token generation</li>
288+
<li><code>pbjs.mergeConfig(uidConfig)</code> - Merges ${IDENTITY_NAME} user ID module configuration into the existing Prebid config without overwriting other settings. This allows adding ${IDENTITY_NAME} after the page has already loaded.</li>
289+
<li><code>pbjs.refreshUserIds()</code> - Triggers Prebid to re-fetch all configured user IDs, including the newly added ${IDENTITY_NAME} module, which initiates token generation using the provided email and CSTG credentials.</li>
291290
</ol>
292291
</div>
293292

@@ -384,50 +383,51 @@ <h3>📄 Config Merged via mergeConfig()</h3>
384383

385384
<!-- Sidebar for Instructions -->
386385
<aside class="sidebar">
387-
<h3>📋 Deferred Loading Flow</h3>
386+
<h3>📋 How to Test</h3>
388387

389388
<div class="section">
390-
<h4>Step 1: Page Loads</h4>
389+
<h4>Step 1: Observe Initial State</h4>
391390
<ul>
392-
<li>Prebid.js loads and initializes</li>
393-
<li><code>setConfig()</code> is called <strong>without</strong> ${IDENTITY_NAME}</li>
391+
<li>Notice the "Initial Prebid Config" box shows no userIds configured</li>
392+
<li>This demonstrates Prebid loading without ${IDENTITY_NAME}</li>
394393
<li>Ads can still be requested (without ${IDENTITY_NAME} targeting)</li>
395394
</ul>
396395
</div>
397396

398397
<div class="section">
399-
<h4>Step 2: User Action</h4>
398+
<h4>Step 2: Configure ${IDENTITY_NAME}</h4>
400399
<ul>
401-
<li>User logs in, gives consent, or other trigger</li>
402-
<li>Your code calls <code>mergeConfig()</code> with ${IDENTITY_NAME} params</li>
403-
<li>Then calls <code>refreshUserIds()</code></li>
400+
<li>Enter an email address in the input field</li>
401+
<li>Click "Configure ${IDENTITY_NAME} with mergeConfig()" button</li>
402+
<li>This adds ${IDENTITY_NAME} to the existing Prebid config</li>
404403
</ul>
405404
</div>
406405

407406
<div class="section">
408-
<h4>Step 3: Token Generated</h4>
407+
<h4>Step 3: Observe Token Generation</h4>
409408
<ul>
410-
<li>${IDENTITY_NAME} token is generated</li>
411-
<li>Token stored in localStorage</li>
412-
<li>Future ad requests include ${IDENTITY_NAME}</li>
409+
<li>Check "Integration Status" table for token values</li>
410+
<li>Verify "Ready for Targeted Advertising" changes to "yes"</li>
411+
<li>See the merged config displayed at the bottom</li>
413412
</ul>
414413
</div>
415414

416-
<div class="section highlight-section">
417-
<h4>🔑 Key APIs Used</h4>
415+
<div class="section">
416+
<h4>Step 4: Test Opt-Out</h4>
418417
<ul>
419-
<li><code>pbjs.mergeConfig()</code> - Add/update config without replacing</li>
420-
<li><code>pbjs.refreshUserIds()</code> - Trigger user ID module refresh</li>
418+
<li>Clear ${IDENTITY_NAME} and try: <strong>[email protected]</strong></li>
419+
<li>Advertising token shows "This email has opted out"</li>
420+
<li>No advertising token is stored</li>
421421
</ul>
422422
</div>
423423

424424
<div class="section">
425-
<h4>Use Cases</h4>
425+
<h4>What's Happening?</h4>
426426
<ul>
427-
<li><strong>Async Login:</strong> User logs in after page load</li>
428-
<li><strong>Delayed Consent:</strong> Consent given after initial load</li>
429-
<li><strong>SPAs:</strong> Single Page Apps with dynamic login</li>
430-
<li><strong>Lazy Loading:</strong> Load ${IDENTITY_NAME} only when needed</li>
427+
<li><strong>Initial Load:</strong> Prebid initializes with <code>setConfig()</code> but no ${IDENTITY_NAME} module configured yet</li>
428+
<li><strong>Deferred Config:</strong> When user provides email, <code>mergeConfig()</code> adds ${IDENTITY_NAME} without overwriting existing settings</li>
429+
<li><strong>Token Generation:</strong> <code>refreshUserIds()</code> triggers Prebid to generate the ${IDENTITY_NAME} token using CSTG credentials</li>
430+
<li><strong>Local Storage:</strong> Prebid stores tokens in localStorage (${UID_STORAGE_KEY}) for persistence across page loads</li>
431431
</ul>
432432
</div>
433433

0 commit comments

Comments
 (0)