From 95762df367f3fe956e8a83385179d3c7c7f5c78a Mon Sep 17 00:00:00 2001 From: Bosko Milekic Date: Mon, 30 Nov 2020 10:14:16 -0500 Subject: [PATCH] Add prebid demo pages pointing to DMX us-east-16 for testing --- Dockerfile | 2 + demos/Makefile | 1 + .../vanilla/targeting/prebid-us-east-16.html | 302 +++++++++++++++++ .../targeting/prebid-us-east-16.html.tpl | 303 ++++++++++++++++++ demos/vanilla/targeting/prebid-us-east-16.js | 5 + 5 files changed, 613 insertions(+) create mode 100644 demos/vanilla/targeting/prebid-us-east-16.html create mode 100644 demos/vanilla/targeting/prebid-us-east-16.html.tpl create mode 100644 demos/vanilla/targeting/prebid-us-east-16.js diff --git a/Dockerfile b/Dockerfile index ff59c19..0bd80cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,9 @@ WORKDIR /usr/share/nginx/html/ COPY --from=build /build/demos/vanilla/targeting/gam360.html ./vanilla/targeting/gam360.html COPY --from=build /build/demos/vanilla/targeting/gam360-cached.html ./vanilla/targeting/gam360-cached.html COPY --from=build /build/demos/vanilla/targeting/prebid.html ./vanilla/targeting/prebid.html +COPY --from=build /build/demos/vanilla/targeting/prebid-us-east-16.html ./vanilla/targeting/prebid-us-east-16.html COPY --from=build /build/demos/vanilla/targeting/prebid.js ./vanilla/targeting/prebid.js +COPY --from=build /build/demos/vanilla/targeting/prebid-us-east-16.js ./vanilla/targeting/prebid-us-east-16.js COPY --from=build /build/demos/vanilla/identify.html ./vanilla/identify.html COPY --from=build /build/demos/vanilla/profile.html ./vanilla/profile.html COPY --from=build /build/demos/vanilla/witness.html ./vanilla/witness.html diff --git a/demos/Makefile b/demos/Makefile index b3bf361..44a26cd 100644 --- a/demos/Makefile +++ b/demos/Makefile @@ -11,6 +11,7 @@ html: envsubst < ./vanilla/targeting/gam360.html.tpl > ./vanilla/targeting/gam360.html && \ envsubst < ./vanilla/targeting/gam360-cached.html.tpl > ./vanilla/targeting/gam360-cached.html && \ envsubst < ./vanilla/targeting/prebid.html.tpl > ./vanilla/targeting/prebid.html && \ + envsubst < ./vanilla/targeting/prebid-us-east-16.html.tpl > ./vanilla/targeting/prebid-us-east-16.html && \ envsubst < ./vanilla/authenticator.html.tpl > ./vanilla/authenticator.html .PHONY: react diff --git a/demos/vanilla/targeting/prebid-us-east-16.html b/demos/vanilla/targeting/prebid-us-east-16.html new file mode 100644 index 0000000..c2e17fa --- /dev/null +++ b/demos/vanilla/targeting/prebid-us-east-16.html @@ -0,0 +1,302 @@ + + + + + Optable Web SDK Demos + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+ +
+
+

Example: targeting & Prebid.js activation

+

+ Shows how to load active cohorts for a visitor and pass them to Prebid.js via + setConfig-fpd. + It's assumed in this example that your primary ad server is + Google Ad Manager (GAM) and that you are integrated with it + using the + Google Publisher Tag (GPT), so + we also pass matching active cohorts to GAM. +

+

+ In this example, we use the targetingFromCache API to retrieve any targeting data from browser + LocalStorage, in order to pass it to both Prebid.js and GPT. We also call the SDK targeting API + which will fetch the latest targeting data from our sandbox and cache it locally for later use. Since these + two events happen asynchronously, it's possible that the targeting data passed to GAM is slightly outdated. + To ensure ad targeting accuracy, we recommend calling targeting to update the local cache on + every page load. +

+
+
+ +
+
+
web-sdk-demo-gam360/header-ad
+ +
+
+
+
+
+
web-sdk-demo-gam360/box-ad
+ +
+
+
+
+
+
web-sdk-demo-gam360/footer-ad
+ +
+
+
+
+
+
+ Home | Contact | + Privacy | + LinkedIn | + Twitter +
+
+
+
+ + + + + + diff --git a/demos/vanilla/targeting/prebid-us-east-16.html.tpl b/demos/vanilla/targeting/prebid-us-east-16.html.tpl new file mode 100644 index 0000000..19da3cb --- /dev/null +++ b/demos/vanilla/targeting/prebid-us-east-16.html.tpl @@ -0,0 +1,303 @@ + + + + + Optable Web SDK Demos + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+ +
+
+

Example: targeting & Prebid.js activation

+

+ Shows how to load active cohorts for a visitor and pass them to Prebid.js via + setConfig-fpd. + It's assumed in this example that your primary ad server is + Google Ad Manager (GAM) and that you are integrated with it + using the + Google Publisher Tag (GPT), so + we also pass matching active cohorts to GAM. +

+

+ In this example, we use the targetingFromCache API to retrieve any targeting data from browser + LocalStorage, in order to pass it to both Prebid.js and GPT. We also call the SDK targeting API + which will fetch the latest targeting data from our sandbox and cache it locally for later use. Since these + two events happen asynchronously, it's possible that the targeting data passed to GAM is slightly outdated. + To ensure ad targeting accuracy, we recommend calling targeting to update the local cache on + every page load. +

+
+
+ +
+
+
web-sdk-demo-gam360/header-ad
+ +
+
+
+
+
+
web-sdk-demo-gam360/box-ad
+ +
+
+
+
+
+
web-sdk-demo-gam360/footer-ad
+ +
+
+
+
+
+
+ Home | Contact | + Privacy | + LinkedIn | + Twitter +
+
+
+
+ + + + + + diff --git a/demos/vanilla/targeting/prebid-us-east-16.js b/demos/vanilla/targeting/prebid-us-east-16.js new file mode 100644 index 0000000..c8a6847 --- /dev/null +++ b/demos/vanilla/targeting/prebid-us-east-16.js @@ -0,0 +1,5 @@ +/* prebid.js v4.18.0-pre +Updated : 2020-11-26 */ +!function(u){var s=window.pbjsChunk;window.pbjsChunk=function(e,t,n){for(var r,i,o,a=0,c=[];a>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},t.getBidIdParameter=function(e,t){if(t&&t[e])return t[e];return""},t.tryAppendQueryString=function(e,t,n){if(n)return e+t+"="+encodeURIComponent(n)+"&";return e},t.parseQueryStringParameters=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+=n+"="+encodeURIComponent(e[n])+"&");return t=t.replace(/&$/,"")},t.transformAdServerTargetingObj=function(t){return t&&0';return n+=''},t.createTrackPixelIframeHtml=se,t.getValueString=de,t.uniques=fe,t.flatten=le,t.getBidRequest=function(n,e){return n?(e.some(function(e){var t=c()(e.bids,function(t){return["bidId","adId","bid_id"].some(function(e){return t[e]===n})});return t&&(r=t),t}),r):void 0;var r},t.getKeys=pe,t.getValue=ge,t.getKeyByValue=function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t)return n},t.getBidderCodes=function(){return(0t[n]?-1:0}},t.parseQS=Ie,t.formatQS=Ce,t.parseUrl=function(e,t){var n=document.createElement("a");t&&"noDecodeWholeURL"in t&&t.noDecodeWholeURL?n.href=e:n.href=decodeURIComponent(e);var r=t&&"decodeSearchAsString"in t&&t.decodeSearchAsString;return{href:n.href,protocol:(n.protocol||"").replace(/:$/,""),hostname:n.hostname,port:+n.port,pathname:n.pathname.replace(/^(?!\/)/,"/"),search:r?n.search:k.parseQS(n.search||""),hash:(n.hash||"").replace(/^#/,""),host:n.host||window.location.host}},t.buildUrl=function(e){return(e.protocol||"http")+"://"+(e.host||e.hostname+(e.port?":".concat(e.port):""))+(e.pathname||"")+(e.search?"?".concat(k.formatQS(e.search||"")):"")+(e.hash?"#".concat(e.hash):"")},t.deepEqual=je,t.mergeDeep=we,t.cyrb53Hash=function(e){for(var t,n=1>>16,2246822507)^r(o^o>>>13,3266489909),(4294967296*(2097151&(o=r(o^o>>>16,2246822507)^r(i^i>>>13,3266489909)))+(i>>>0)).toString()};var r=n(3),i=n(159),o=n.n(i),a=n(10),c=n.n(a),u=n(12),s=n.n(u),d=n(160);n.d(t,"deepAccess",function(){return d.a});var f=n(161);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n