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