Skip to content

Commit 71935be

Browse files
bmilekicBosko Milekiczapo
authored
Update Terms link everywhere and add AdCP gam demo page. (#236)
Co-authored-by: Bosko Milekic <bmilekic@MBP-0041.local> Co-authored-by: Antoine Niek <antoineniek@gmail.com>
1 parent 36926ff commit 71935be

23 files changed

Lines changed: 330 additions & 19 deletions

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ demo-html:
5050
envsubst $(DEMO_VARS) < demos/vanilla/profile.html.tpl > demos/vanilla/profile.html
5151
envsubst $(DEMO_VARS) < demos/vanilla/targeting/gam360.html.tpl > demos/vanilla/targeting/gam360.html
5252
envsubst $(DEMO_VARS) < demos/vanilla/targeting/gam360-cached.html.tpl > demos/vanilla/targeting/gam360-cached.html
53+
envsubst $(DEMO_VARS) < demos/vanilla/targeting/gam360-adcp.html.tpl > demos/vanilla/targeting/gam360-adcp.html
5354
envsubst $(DEMO_VARS) < demos/vanilla/targeting/prebid.html.tpl > demos/vanilla/targeting/prebid.html
5455
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/identify.html.tpl > demos/vanilla/nocookies/identify.html
5556
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/witness.html.tpl > demos/vanilla/nocookies/witness.html
5657
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/profile.html.tpl > demos/vanilla/nocookies/profile.html
5758
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/gam360.html.tpl > demos/vanilla/nocookies/targeting/gam360.html
5859
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/gam360-cached.html.tpl > demos/vanilla/nocookies/targeting/gam360-cached.html
60+
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/gam360-adcp.html.tpl > demos/vanilla/nocookies/targeting/gam360-adcp.html
5961
envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/prebid.html.tpl > demos/vanilla/nocookies/targeting/prebid.html
6062
envsubst $(DEMO_VARS) < demos/vanilla/uid2_token/login.html.tpl > demos/vanilla/uid2_token/login.html
6163
envsubst $(DEMO_VARS) < demos/vanilla/uid2_token/index.html.tpl > demos/vanilla/uid2_token/index.html

demos/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ WORKDIR /usr/share/nginx/html/
33

44
COPY --chmod=0444 ./vanilla/targeting/gam360.html ./vanilla/targeting/gam360.html
55
COPY --chmod=0444 ./vanilla/targeting/gam360-cached.html ./vanilla/targeting/gam360-cached.html
6+
COPY --chmod=0444 ./vanilla/targeting/gam360-adcp.html ./vanilla/targeting/gam360-adcp.html
67
COPY --chmod=0444 ./vanilla/targeting/prebid.html ./vanilla/targeting/prebid.html
78
COPY --chmod=0444 ./vanilla/targeting/prebid.js ./vanilla/targeting/prebid.js
89
COPY --chmod=0444 ./vanilla/identify.html ./vanilla/identify.html
910
COPY --chmod=0444 ./vanilla/profile.html ./vanilla/profile.html
1011
COPY --chmod=0444 ./vanilla/witness.html ./vanilla/witness.html
1112
COPY --chmod=0444 ./vanilla/nocookies/targeting/gam360.html ./vanilla/nocookies/targeting/gam360.html
1213
COPY --chmod=0444 ./vanilla/nocookies/targeting/gam360-cached.html ./vanilla/nocookies/targeting/gam360-cached.html
14+
COPY --chmod=0444 ./vanilla/nocookies/targeting/gam360-adcp.html ./vanilla/nocookies/targeting/gam360-adcp.html
1315
COPY --chmod=0444 ./vanilla/nocookies/targeting/prebid.html ./vanilla/nocookies/targeting/prebid.html
1416
COPY --chmod=0444 ./vanilla/nocookies/targeting/prebid.js ./vanilla/nocookies/targeting/prebid.js
1517
COPY --chmod=0444 ./vanilla/nocookies/identify.html ./vanilla/nocookies/identify.html

demos/index-nocookies.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ <h5>Audience Targeting</h5>
109109
ad targeting.
110110
</td>
111111
</tr>
112+
<tr>
113+
<td>
114+
<a href="/vanilla/nocookies/targeting/gam360-adcp.html">targeting: GAM360 (AdCP)</a>
115+
</td>
116+
<td>
117+
Demo of AdCP sales agent campaigns.
118+
Shows how to load and cache active cohorts in a visitor's browser. Separately, cached cohorts are
119+
passed to <a href="https://admanager.google.com/home/">Google Ad Manager</a> (GAM) via the
120+
<a href="https://developers.google.com/publisher-tag/guides/get-started">Google Publisher Tag</a> for
121+
ad targeting.
122+
</td>
123+
</tr>
112124
<tr>
113125
<td><a href="/vanilla/nocookies/targeting/prebid.html">targeting: Prebid.js</a></td>
114126
<td>
@@ -163,7 +175,7 @@ <h5>ID Resolution</h5>
163175
<center>
164176
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
165177
<a href="https://docs.optable.co/">Documentation</a> |
166-
<a href="https://www.optable.co/privacy/products-and-services-privacy-policy">Privacy</a> |
178+
<a href="https://terms.optable.co/">Terms</a> |
167179
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
168180
<a href="https://twitter.com/optable_co">Twitter</a>
169181
</center>

demos/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ <h5>Audience Targeting</h5>
116116
ad targeting.
117117
</td>
118118
</tr>
119+
<tr>
120+
<td>
121+
<a href="/vanilla/targeting/gam360-adcp.html">targeting: GAM360 (AdCP)</a>
122+
</td>
123+
<td>
124+
Demo of AdCP sales agent campaigns.
125+
Shows how to load and cache active cohorts in a visitor's browser. Separately, cached cohorts are
126+
passed to <a href="https://admanager.google.com/home/">Google Ad Manager</a> (GAM) via the
127+
<a href="https://developers.google.com/publisher-tag/guides/get-started">Google Publisher Tag</a> for
128+
ad targeting.
129+
</td>
130+
</tr>
119131
<tr>
120132
<td><a href="/vanilla/targeting/prebid.html">targeting: Prebid.js</a></td>
121133
<td>
@@ -170,7 +182,7 @@ <h5>ID Resolution</h5>
170182
<center>
171183
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
172184
<a href="https://docs.optable.co/">Documentation</a> |
173-
<a href="https://www.optable.co/privacy/products-and-services-privacy-policy">Privacy</a> |
185+
<a href="https://terms.optable.co/">Terms</a> |
174186
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
175187
<a href="https://twitter.com/optable_co">Twitter</a>
176188
</center>

demos/react/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h4>Example: identify API from ReactJS app using cookies</h4>
5757
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
5858
<center>
5959
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
60-
<a href="https://www.optable.co/privacy/products-and-services-privacy-policy">Privacy</a> |
60+
<a href="https://terms.optable.co/">Terms</a> |
6161
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
6262
<a href="https://twitter.com/optable_co">Twitter</a>
6363
</center>

demos/vanilla/identify.html.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
8989
<center>
9090
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
91-
<a href="https://optable.co/privacy">Privacy</a> |
91+
<a href="https://terms.optable.co/">Terms</a> |
9292
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
9393
<a href="https://twitter.com/optable_co">Twitter</a>
9494
</center>

demos/vanilla/nocookies/identify.html.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
9090
<center>
9191
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
92-
<a href="https://optable.co/privacy">Privacy</a> |
92+
<a href="https://terms.optable.co/">Terms</a> |
9393
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
9494
<a href="https://twitter.com/optable_co">Twitter</a>
9595
</center>

demos/vanilla/nocookies/profile.html.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
8585
<center>
8686
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
87-
<a href="https://optable.co/privacy">Privacy</a> |
87+
<a href="https://terms.optable.co/">Terms</a> |
8888
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
8989
<a href="https://twitter.com/optable_co">Twitter</a>
9090
</center>
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Optable Web SDK Demos</title>
6+
<meta name="description" content="Optable Web SDK Demos" />
7+
<meta name="author" content="optable.co" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css" />
10+
<link rel="stylesheet" href="/css/normalize.css" />
11+
<link rel="stylesheet" href="/css/skeleton.css" />
12+
<link rel="icon" type="image/png" href="/images/favicon.png" />
13+
14+
<!-- Optable web-sdk loader start -->
15+
<script type="text/javascript">
16+
window.optable = window.optable || { cmd: [] };
17+
18+
optable.cmd.push(function () {
19+
optable.instance = new optable.SDK({
20+
host: "${DCN_HOST}",
21+
initPassport: JSON.parse("${DCN_INIT}"),
22+
site: "${DCN_SITE}",
23+
cookies: false,
24+
node: "${DCN_NODE}",
25+
});
26+
27+
optable.instance.tryIdentifyFromParams();
28+
});
29+
</script>
30+
<script async src="${SDK_URI}"></script>
31+
<!-- Optable web-sdk loader end -->
32+
33+
<!-- Optable web-sdk inject targeting start -->
34+
<script>
35+
// Hook GPT event listeners and send events to DCN:
36+
optable.cmd.push(function () {
37+
optable.instance.installGPTEventListeners();
38+
});
39+
40+
// Try to fetch and cache targeting data from DCN:
41+
optable.cmd.push(function () {
42+
optable.instance.targeting().catch((err) => {
43+
console.log("[OptableSDK] targeting() exception: " + err.message);
44+
});
45+
});
46+
</script>
47+
<!-- Optable web-sdk inject targeting end -->
48+
49+
<!-- GPT header tag start -->
50+
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
51+
<script>
52+
window.googletag = window.googletag || { cmd: [] };
53+
54+
googletag.cmd.push(function () {
55+
headerAd = googletag
56+
.defineSlot('/22081946781/agentic-buyer-demo', [728, 90], 'div-gpt-ad-1761329463906-0')
57+
.addService(googletag.pubads());
58+
59+
// Setup page-level GAM targeting from any cached targeting data and load ads as usual:
60+
optable.cmd.push(function () {
61+
const gamTargeting = optable.instance.targetingKeyValuesFromCache();
62+
63+
if (gamTargeting) {
64+
for (const [key, values] of Object.entries(gamTargeting)) {
65+
googletag.pubads().setTargeting(key, values);
66+
console.log("[OptableSDK] googletag.pubads().setTargeting(" + key + ", [" + values + "])");
67+
}
68+
}
69+
70+
googletag.pubads().enableSingleRequest();
71+
googletag.enableServices();
72+
73+
console.log("[GPT] googletag.enableServices()");
74+
});
75+
});
76+
</script>
77+
<!-- GPT header tag end -->
78+
</head>
79+
<body>
80+
<div class="container">
81+
<div class="row">
82+
<div class="twelve column" style="margin-top: 5%;">
83+
<a href="/"><img src="/images/logo.png" width="200" /></a>
84+
<hr />
85+
</div>
86+
</div>
87+
88+
<div class="row">
89+
<div class="twelve column">
90+
<h4>Example: targeting API: GAM360 (AdCP)</h4>
91+
<p>
92+
Shows how to load and cache active cohorts in a visitor's browser. Separately, cached cohorts are passed to
93+
<a href="https://admanager.google.com/home/">Google Ad Manager</a> (GAM) via the
94+
<a href="https://developers.google.com/publisher-tag/guides/get-started">Google Publisher Tag</a> (GPT) for
95+
ad targeting.
96+
</p>
97+
<p>
98+
In this example, we use the <code>targetingKeyValuesFromCache()</code> API to retrieve any targeting data from
99+
browser LocalStorage, in order to pass it to GPT via <code>googletag.pubads().setTargeting()</code>. We also
100+
call the SDK <code>targeting</code> API which will fetch the latest targeting data from our DCN and
101+
cache it locally for later use. Since these two events happen asynchronously, it's possible that the
102+
targeting data passed to GAM is slightly outdated. To ensure ad targeting accuracy, it is recommended to call
103+
<code>targeting</code> to update the local cache on page load.
104+
</p>
105+
<p>
106+
If you are comfortable with disabling initial load on GAM ads and always loading them explicitly with the
107+
very latest targeting data, have a look at the
108+
<a href="/vanilla/targeting/gam360.html">original targeting &amp; GAM360 activation</a> example instead.
109+
</p>
110+
</div>
111+
</div>
112+
113+
<div class="row">
114+
<div class="twelve column">
115+
<h5>agentic-buyer-demo/728x90</h5>
116+
<!-- GAM360 Ad Unit slot: agentic-buyer-demo/728x90 -->
117+
<div id="div-gpt-ad-1761329463906-0" style="width: 728px; height: 90px;"></div>
118+
</div>
119+
</div>
120+
<div class="row">
121+
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
122+
<center>
123+
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
124+
<a href="https://terms.optable.co/">Terms</a> |
125+
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
126+
<a href="https://twitter.com/optable_co">Twitter</a>
127+
</center>
128+
</div>
129+
</div>
130+
</div>
131+
132+
<!-- GPT body tag start -->
133+
<script>
134+
googletag.cmd.push(function () {
135+
googletag.display(headerAd);
136+
137+
console.log("[GPT] googletag.display() all slots");
138+
});
139+
</script>
140+
<!-- GPT body tag end -->
141+
</body>
142+
</html>

demos/vanilla/nocookies/targeting/gam360-cached.html.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
<div class="twelve column" style="font-size: 0.8rem; padding: 10px;">
150150
<center>
151151
<a href="https://www.optable.co/">Home</a> | <a href="https://www.optable.co/company/contact">Contact</a> |
152-
<a href="https://optable.co/privacy">Privacy</a> |
152+
<a href="https://terms.optable.co/">Terms</a> |
153153
<a href="https://www.linkedin.com/company/optableco/">LinkedIn</a> |
154154
<a href="https://twitter.com/optable_co">Twitter</a>
155155
</center>

0 commit comments

Comments
 (0)