Skip to content

Commit 8d15659

Browse files
seperate table and data for uid2 and google secure information
1 parent 945fef5 commit 8d15659

File tree

3 files changed

+71
-56
lines changed

3 files changed

+71
-56
lines changed

web-integrations/google-secure-signals/server-side/public/stylesheets/app.css

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

131+
h2.section-teal {
132+
border-bottom-color: var(--accent-teal);
133+
}
134+
131135
p {
132136
font-size: 0.95rem;
133137
color: var(--text-gray);
@@ -146,8 +150,9 @@ a:hover {
146150
opacity: 0.8;
147151
}
148152

149-
/* State Table */
150-
#uid_state {
153+
/* State Tables */
154+
#uid_state,
155+
#secure_signals_state {
151156
width: 100%;
152157
border-collapse: collapse;
153158
margin: 2rem 0;
@@ -158,19 +163,23 @@ a:hover {
158163
position: relative;
159164
}
160165

161-
#uid_state tr {
166+
#uid_state tr,
167+
#secure_signals_state tr {
162168
border-bottom: 1px solid var(--border-color);
163169
}
164170

165-
#uid_state tr:nth-child(even) {
171+
#uid_state tr:nth-child(even),
172+
#secure_signals_state tr:nth-child(even) {
166173
background-color: var(--bg-light);
167174
}
168175

169-
#uid_state tr:last-child {
176+
#uid_state tr:last-child,
177+
#secure_signals_state tr:last-child {
170178
border-bottom: none;
171179
}
172180

173-
#uid_state td {
181+
#uid_state td,
182+
#secure_signals_state td {
174183
padding: 1rem;
175184
vertical-align: top;
176185
}
@@ -336,7 +345,7 @@ a:hover {
336345

337346
/* Video Container Styling */
338347
#googleAdContainer {
339-
margin-bottom: 2rem;
348+
margin-top: 2rem;
340349
}
341350

342351
@media (max-width: 1024px) {

web-integrations/google-secure-signals/server-side/public/stylesheets/style.css

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@
2222
#playButton {
2323
margin-top: 10px;
2424
vertical-align: top;
25-
width: 350px;
26-
height: 60px;
27-
padding: 0;
28-
font-size: 22px;
25+
width: 100px;
26+
height: 36px;
27+
padding: 0 16px;
28+
font-size: 14px;
29+
font-weight: 600;
2930
color: white;
3031
text-align: center;
31-
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
3232
background: #2c3e50;
3333
border: 0;
34-
border-bottom: 2px solid #22303f;
34+
border-radius: 6px;
3535
cursor: pointer;
36-
-webkit-box-shadow: inset 0 -2px #22303f;
37-
box-shadow: inset 0 -2px #22303f;
3836
}

web-integrations/google-secure-signals/server-side/views/index.html

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
1212

1313
<script type="text/javascript">
14-
const getAdvertisingToken = async () => {
14+
const getUid2AdvertisingToken = async () => {
1515
const response = await fetch('/getFreshToken');
1616
const result = await response.json();
1717
console.log(result);
1818
return result.advertising_token;
1919
};
2020

21-
window.getAdvertisingToken = getAdvertisingToken;
21+
window.getUid2AdvertisingToken = getUid2AdvertisingToken;
2222

23-
// If secureSignalProvider is initialized before getAdvertisingToken is assigned, call registerSecureSignalProvider
24-
const providerName = '__' + '<%- identityName %>'.toLowerCase() + 'SecureSignalProvider';
25-
if (window[providerName]) {
26-
window[providerName].registerSecureSignalProvider();
23+
// If uid2SecureSignalProvider is initialized before getUid2AdvertisingToken is assigned, call registerSecureSignalProvider
24+
if (window.__uid2SecureSignalProvider) {
25+
window.__uid2SecureSignalProvider.registerSecureSignalProvider();
2726
}
2827
</script>
2928
<script>
@@ -80,22 +79,33 @@ <h1>Server-Side <%- identityName %> Integration Example with Google Secure Signa
8079
[<a href="https://github.com/IABTechLab/uid2-examples/tree/main/web-integrations/google-secure-signals/server-side">Source Code</a>]
8180
</p>
8281

83-
<% if (identity) { %>
84-
<div id="googleAdContainer">
85-
<div id="mainContainer">
86-
<div id="content">
87-
<video id="contentElement">
88-
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
89-
</video>
82+
<!-- Generate/Clear buttons at the top for easy access -->
83+
<% if (!identity && !isOptout) { %>
84+
<div id="login_form" class="form" style="margin-top: 0; margin-bottom: 2rem;">
85+
<form action="/login" method="POST">
86+
<div class="form-inline">
87+
<input
88+
type="text"
89+
id="email"
90+
name="email"
91+
placeholder="Enter an email address"
92+
class="email-input"
93+
/>
94+
<input type="submit" value="Generate <%- identityName %>" class="button" />
9095
</div>
91-
<div id="adContainer"></div>
92-
</div>
93-
<button id="playButton">Play</button>
94-
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
95-
<script type="text/javascript" src="ads.js"></script>
96+
</form>
97+
</div>
98+
<% } else if (isOptout) { %>
99+
<div id="optout_form" class="form" style="margin-top: 0; margin-bottom: 2rem;">
100+
<button type="button" class="button" id="try_another">Try Another Email</button>
101+
</div>
102+
<% } else { %>
103+
<div id="logout_form" class="form" style="margin-top: 0; margin-bottom: 2rem;">
104+
<button type="button" class="button" id="logout">Clear <%- identityName %></button>
96105
</div>
97106
<% } %>
98107

108+
<!-- UID2 Integration Status Section -->
99109
<h2><%- identityName %> Integration Status</h2>
100110

101111
<table id="uid_state">
@@ -169,6 +179,12 @@ <h2><%- identityName %> Integration Status</h2>
169179
</td>
170180
<td class="value"><pre><%= identity ? JSON.stringify(identity, null, 2) : 'null' %></pre></td>
171181
</tr>
182+
</table>
183+
184+
<!-- Google Secure Signals Section -->
185+
<h2 class="section-teal">Google Secure Signals Status</h2>
186+
187+
<table id="secure_signals_state">
172188
<tr>
173189
<td class="label">
174190
<div class="tooltip-wrapper">
@@ -181,7 +197,7 @@ <h2><%- identityName %> Integration Status</h2>
181197
</div>
182198
</div>
183199
</td>
184-
<td class="value"><pre id="secure_signals_loaded">checking...</pre></td>
200+
<td class="value"><pre id="secure_signals_loaded">no</pre></td>
185201
</tr>
186202
<tr>
187203
<td class="label">
@@ -195,32 +211,24 @@ <h2><%- identityName %> Integration Status</h2>
195211
</div>
196212
</div>
197213
</td>
198-
<td class="value"><pre id="secure_signals_value">checking...</pre></td>
214+
<td class="value"><pre id="secure_signals_value">undefined</pre></td>
199215
</tr>
200216
</table>
201217

202-
<% if (!identity && !isOptout) { %>
203-
<div id="login_form" class="form">
204-
<form action="/login" method="POST">
205-
<div class="form-inline">
206-
<input
207-
type="text"
208-
id="email"
209-
name="email"
210-
placeholder="Enter an email address"
211-
class="email-input"
212-
/>
213-
<input type="submit" value="Generate <%- identityName %>" class="button" />
218+
<!-- Video Ad Container - at the bottom -->
219+
<% if (identity) { %>
220+
<div id="googleAdContainer">
221+
<div id="mainContainer">
222+
<div id="content">
223+
<video id="contentElement">
224+
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
225+
</video>
214226
</div>
215-
</form>
216-
</div>
217-
<% } else if (isOptout) { %>
218-
<div id="optout_form" class="form">
219-
<button type="button" class="button" id="try_another">Try Another Email</button>
220-
</div>
221-
<% } else { %>
222-
<div id="logout_form" class="form">
223-
<button type="button" class="button" id="logout">Clear <%- identityName %></button>
227+
<div id="adContainer"></div>
228+
</div>
229+
<button id="playButton">Play</button>
230+
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
231+
<script type="text/javascript" src="ads.js"></script>
224232
</div>
225233
<% } %>
226234
</div>

0 commit comments

Comments
 (0)