Skip to content

Commit b93c457

Browse files
update minor prebid secure big and fix ui spacing accross prebid
1 parent ffde949 commit b93c457

File tree

3 files changed

+77
-31
lines changed

3 files changed

+77
-31
lines changed

web-integrations/prebid-integrations/client-server/public/app.css

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,26 @@ h2 {
128128
border-bottom: 3px solid var(--primary-orange);
129129
}
130130

131+
/* Teal section header for Prebid */
132+
h2.section-teal {
133+
border-bottom: 3px solid var(--accent-teal);
134+
}
135+
131136
p {
132137
font-size: 0.95rem;
133138
color: var(--text-gray);
134139
margin-bottom: 2rem;
135140
line-height: 1.8;
136141
}
137142

143+
/* Section summary - same styling as intro but gray */
144+
p.section-summary {
145+
font-size: 0.95rem;
146+
color: var(--text-gray);
147+
margin-bottom: 1rem;
148+
line-height: 1.8;
149+
}
150+
138151
a {
139152
color: var(--link-color);
140153
text-decoration: underline;
@@ -146,32 +159,46 @@ a:hover {
146159
opacity: 0.8;
147160
}
148161

149-
/* State Table */
162+
/* State Tables */
150163
#uid_state {
151164
width: 100%;
152165
border-collapse: collapse;
153166
margin: 2rem 0;
154167
font-size: 0.875rem;
155168
border: 1px solid var(--border-color);
156169
border-radius: 8px;
157-
overflow: hidden;
170+
overflow: visible;
158171
position: relative;
172+
}
173+
174+
#prebid_state {
175+
width: 100%;
176+
border-collapse: collapse;
177+
margin: 1rem 0 2rem 0;
178+
font-size: 0.875rem;
179+
border: 1px solid var(--border-color);
180+
border-radius: 8px;
159181
overflow: visible;
182+
position: relative;
160183
}
161184

162-
#uid_state tr {
185+
#uid_state tr,
186+
#prebid_state tr {
163187
border-bottom: 1px solid var(--border-color);
164188
}
165189

166-
#uid_state tr:nth-child(even) {
190+
#uid_state tr:nth-child(even),
191+
#prebid_state tr:nth-child(even) {
167192
background-color: var(--bg-light);
168193
}
169194

170-
#uid_state tr:last-child {
195+
#uid_state tr:last-child,
196+
#prebid_state tr:last-child {
171197
border-bottom: none;
172198
}
173199

174-
#uid_state td {
200+
#uid_state td,
201+
#prebid_state td {
175202
padding: 1rem;
176203
vertical-align: top;
177204
}
@@ -200,6 +227,11 @@ a:hover {
200227
margin-top: 2rem;
201228
}
202229

230+
.form.top-form {
231+
margin-top: 0;
232+
margin-bottom: 2rem;
233+
}
234+
203235
.form-inline {
204236
display: flex;
205237
gap: 0;

web-integrations/prebid-integrations/client-server/public/index.html

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,23 @@ <h1>Client-Server <%- identityName %> SDK Integration Example with Prebid.js</h1
194194
This example demonstrates how a content publisher can integrate with <%- identityName %> and Prebid.js using the <a href="<%- docsBaseUrl %>/guides/integration-prebid-client-server"><%- identityName %> Client-Server Integration Guide for Prebid.js</a>, where tokens are generated on the server and passed to Prebid.js on the client side.
195195
</p>
196196

197+
<!-- Generate/Clear buttons at the top for easy access -->
198+
<div id="login_form" style="display: none" class="form top-form">
199+
<div class="form-inline">
200+
<input
201+
type="text"
202+
id="email"
203+
name="email"
204+
placeholder="Enter an email address"
205+
class="email-input"
206+
/>
207+
<button type="button" class="button" id="login">Generate <%- identityName %></button>
208+
</div>
209+
</div>
210+
<div id="clear_storage_form" style="display: none" class="form top-form">
211+
<button type="button" class="button" id="clear_storage">Clear <%- identityName %></button>
212+
</div>
213+
197214
<h2><%- identityName %> Integration Status</h2>
198215

199216
<table id="uid_state">
@@ -209,9 +226,9 @@ <h2><%- identityName %> Integration Status</h2>
209226
</div>
210227
</div>
211228
</td>
212-
<td class="value"><pre id="targeted_advertising_ready"></pre></td>
213-
</tr>
214-
<tr>
229+
<td class="value"><pre id="targeted_advertising_ready"></pre></td>
230+
</tr>
231+
<tr>
215232
<td class="label">
216233
<div class="tooltip-wrapper">
217234
Advertising Token:
@@ -223,8 +240,8 @@ <h2><%- identityName %> Integration Status</h2>
223240
</div>
224241
</div>
225242
</td>
226-
<td class="value"><pre id="advertising_token"></pre></td>
227-
</tr>
243+
<td class="value"><pre id="advertising_token"></pre></td>
244+
</tr>
228245
<tr>
229246
<td class="label">
230247
<div class="tooltip-wrapper">
@@ -239,6 +256,13 @@ <h2><%- identityName %> Integration Status</h2>
239256
</td>
240257
<td class="value"><pre id="login_required"></pre></td>
241258
</tr>
259+
</table>
260+
261+
<!-- Prebid Integration Status Section -->
262+
<h2 class="section-teal">Prebid Integration Status</h2>
263+
<p class="section-summary">Prebid.js manages token storage in localStorage and shares it with bidders during header bidding auctions.</p>
264+
265+
<table id="prebid_state">
242266
<tr>
243267
<td class="label">
244268
<div class="tooltip-wrapper">
@@ -253,24 +277,8 @@ <h2><%- identityName %> Integration Status</h2>
253277
</td>
254278
<td class="value"><pre id="prebid_storage"></pre></td>
255279
</tr>
256-
</table>
280+
</table>
257281

258-
<div id="login_form" style="display: none" class="form">
259-
<div class="form-inline">
260-
<input
261-
type="text"
262-
id="email"
263-
name="email"
264-
placeholder="Enter an email address"
265-
class="email-input"
266-
/>
267-
<button type="button" class="button" id="login">Generate <%- identityName %></button>
268-
</div>
269-
</div>
270-
271-
<div id="clear_storage_form" style="display: none" class="form">
272-
<button type="button" class="button" id="clear_storage">Clear <%- identityName %></button>
273-
</div>
274282
</div>
275283

276284
<!-- Sidebar for Instructions -->

web-integrations/prebid-secure-signals/client-side/index.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,16 @@
9797
// Check if user is opted out first
9898
const storedToken = localStorage.getItem(storageKey);
9999
let isOptedOut = false;
100+
let hasTokenInStorage = false;
101+
100102
if (storedToken) {
101103
try {
102104
const tokenData = JSON.parse(storedToken);
103105
isOptedOut = tokenData.latestToken === 'optout';
106+
// Check if there's a valid token in storage
107+
if (tokenData.latestToken && tokenData.latestToken.advertising_token) {
108+
hasTokenInStorage = true;
109+
}
104110
} catch (e) {
105111
// Ignore parse errors
106112
}
@@ -113,9 +119,9 @@
113119
return;
114120
}
115121

116-
// Check if Prebid has the token and encryptedSignalSources is configured
117-
const prebidUserIds = pbjs.getUserIds();
118-
const uidToken = prebidUserIds[userIdName];
122+
// Check if Prebid has the token (either from getUserIds or localStorage)
123+
const prebidUserIds = pbjs.getUserIds ? pbjs.getUserIds() : {};
124+
const uidToken = prebidUserIds[userIdName] || hasTokenInStorage;
119125

120126
// Check if encryptedSignalSources is configured
121127
const prebidConfig = pbjs.getConfig('encryptedSignalSources');

0 commit comments

Comments
 (0)