|
| 1 | +<!-- each id module, for it to work, needs to be embedded in prebid.js bundle --> |
| 2 | +<!-- see https://docs.prebid.org/dev-docs/modules/userId.html --> |
| 3 | + |
| 4 | +<!-- for publisher to provide their own IDs, they can use the pubProvidedIdSystem module --> |
| 5 | +<!-- see https://docs.prebid.org/dev-docs/modules/userid-submodules/pubprovided.html --> |
| 6 | + |
| 7 | +<!-- this file can be tested with --> |
| 8 | +<!-- gulp serve --notest --modules=rtdModule,raveltechRtdProvider,appnexusBidAdapter,userId --> |
| 9 | + |
| 10 | +<!DOCTYPE html> |
| 11 | +<html lang="en"> |
| 12 | + |
| 13 | +<head> |
| 14 | + <title>User ID Modules Example</title> |
| 15 | + |
| 16 | + <script> |
| 17 | + var FAILSAFE_TIMEOUT = 2000; |
| 18 | + |
| 19 | + var adUnits = [ |
| 20 | + { |
| 21 | + code: 'test-div', |
| 22 | + mediaTypes: { |
| 23 | + banner: { |
| 24 | + sizes: [[300, 250], [300, 600], [728, 90]] |
| 25 | + } |
| 26 | + }, |
| 27 | + bids: [ |
| 28 | + { |
| 29 | + bidder: 'appnexus', |
| 30 | + params: { |
| 31 | + placementId: 234234, |
| 32 | + } |
| 33 | + } |
| 34 | + ] |
| 35 | + } |
| 36 | + ]; |
| 37 | + |
| 38 | + var pbjs = pbjs || {}; |
| 39 | + pbjs.que = pbjs.que || []; |
| 40 | + </script> |
| 41 | + <script async src="https://cdn.rvlproxy.net/latest/zkad.js"></script> |
| 42 | + <script async src="../../build/dev/prebid.js"></script> |
| 43 | + |
| 44 | + <script> |
| 45 | + function getHashedEmail() { } |
| 46 | + var googletag = googletag || {}; |
| 47 | + googletag.cmd = googletag.cmd || []; |
| 48 | + googletag.cmd.push(function () { |
| 49 | + googletag.pubads().disableInitialLoad(); |
| 50 | + }); |
| 51 | + |
| 52 | + pbjs.que.push(function () { |
| 53 | + pbjs.setConfig({ |
| 54 | + "debug": true, |
| 55 | + |
| 56 | + "realTimeData": { |
| 57 | + dataProviders: [{ |
| 58 | + name: 'raveltech', |
| 59 | + params: { |
| 60 | + bidders: ['appnexus'], |
| 61 | + // Set to true if you want to keep the original bid request along with the RTD‐modified one. |
| 62 | + preserveOriginalBid: false |
| 63 | + } |
| 64 | + }] |
| 65 | + }, |
| 66 | + |
| 67 | + // ************************************************************************* |
| 68 | + // ** COMMENT consentManagement BLOCK IF YOU DO NOT WANT TO SIMULATE GDPR ** |
| 69 | + // ************************************************************************* |
| 70 | + "consentManagement": { |
| 71 | + "cmpApi": "static", |
| 72 | + "consentData": { |
| 73 | + "getTCData": { |
| 74 | + "tcString": "CO-HDlqO-HDlqAKAXCENBDCsAP_AAH_AACiQHKNd_X_fb39j-_59_9t0eY1f9_7_v20zjgeds-8Nyd_X_L8X42M7vF36pq4KuR4Eu3LBIQFlHOHcTUmw6IkVqTPsak2Mr7NKJ7PEinMbe2dYGHtfn9VTuZKYr97s___z__-__v__75f_r-3_3_vp9V---_fA5QAkw1L4CLMSxwJJo0qhRAhCuJDoAQAUUIwtE1hASuCnZXAR-ggYAIDUBGBECDEFGLIIAAAAAkoiAkAPBAIgCIBAACAFSAhAARoAgsAJAwCAAUA0LACKAIQJCDI4KjlMCAiRaKCeSMASi72MMIQyigBoFH4AAAAA.cAAAAAAAAAAA", |
| 75 | + "cmpId": 10, |
| 76 | + "cmpVersion": 23, |
| 77 | + "tcfPolicyVersion": 2, |
| 78 | + "gdprApplies": true, |
| 79 | + "cmpStatus": "loaded", |
| 80 | + "eventStatus": "tcloaded", |
| 81 | + "purpose": { |
| 82 | + "consents": { |
| 83 | + "1": true, |
| 84 | + "2": true |
| 85 | + } |
| 86 | + }, |
| 87 | + "vendor": { |
| 88 | + "consents": { |
| 89 | + // add your GVL ID here and set to true to give consent within pbjs |
| 90 | + "52": true, // rubicon for adserving |
| 91 | + "21": true, // unifiedId |
| 92 | + "131": true, // id5Id |
| 93 | + "929": true, // parrableId |
| 94 | + "97": true, // identityLink |
| 95 | + "887": true, // uid2 |
| 96 | + "95": true, // lotamePanoramaId |
| 97 | + "301": true, // zeotapIdPlus |
| 98 | + "91": true, // criteo |
| 99 | + "737": true, // amxId |
| 100 | + "58": true, // 33acrossId |
| 101 | + "32": true, // Appnexus (as well as for raveltech) |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + } |
| 106 | + }, |
| 107 | + "userSync": { |
| 108 | + "userIds": [ |
| 109 | + { |
| 110 | + "name": "pubProvidedId", |
| 111 | + "params": { |
| 112 | + "eids": [ |
| 113 | + { |
| 114 | + "source": "adnxs.com", |
| 115 | + "uids": [ |
| 116 | + { |
| 117 | + "id": "123456", |
| 118 | + "atype": 1, |
| 119 | + "ext": { |
| 120 | + "stype": "ppuid" // allowable options are sha256email, DMP, ppuid for now |
| 121 | + } |
| 122 | + } |
| 123 | + ] |
| 124 | + }, |
| 125 | + { |
| 126 | + "source": "weborama_fr", |
| 127 | + "uids": [ |
| 128 | + { |
| 129 | + "id": "654321", |
| 130 | + "atype": 1, |
| 131 | + "ext": { |
| 132 | + "stype": "ppuid" // allowable options are sha256email, DMP, ppuid for now |
| 133 | + } |
| 134 | + } |
| 135 | + ] |
| 136 | + }, |
| 137 | + |
| 138 | + ], |
| 139 | + "eidsFunction": getHashedEmail // any user defined function that exists in the page |
| 140 | + } |
| 141 | + }, |
| 142 | + { |
| 143 | + "name": "unifiedId", |
| 144 | + "params": { |
| 145 | + "partner": "prebid", |
| 146 | + "url": "http://match.adsrvr.org/track/rid?ttd_pid=prebid&fmt=json" |
| 147 | + }, |
| 148 | + "storage": { |
| 149 | + "type": "html5", |
| 150 | + "name": "unifiedid", |
| 151 | + "expires": 30 |
| 152 | + } |
| 153 | + }, |
| 154 | + { |
| 155 | + "name": "33acrossId", |
| 156 | + "params": { |
| 157 | + "pid": '0' |
| 158 | + }, |
| 159 | + "storage": { |
| 160 | + "type": 'html5', |
| 161 | + "name": '33acrossId', |
| 162 | + "expires": 90 |
| 163 | + } |
| 164 | + }, |
| 165 | + { |
| 166 | + "name": "intentIqId", |
| 167 | + "params": { |
| 168 | + "partner": 0 // Set your real IntentIQ partner ID here for production. |
| 169 | + }, |
| 170 | + "storage": { |
| 171 | + "type": "cookie", |
| 172 | + "name": "intentIqId", |
| 173 | + "expires": 30 |
| 174 | + } |
| 175 | + }, |
| 176 | + { |
| 177 | + "name": "id5Id", |
| 178 | + "params": { |
| 179 | + "partner": 173 // Set your real ID5 partner ID here for production, please ask for one at http://id5.io/prebid |
| 180 | + }, |
| 181 | + "storage": { |
| 182 | + "type": "html5", |
| 183 | + "name": "id5id", |
| 184 | + "expires": 90, |
| 185 | + "refreshInSeconds": 10// 8*3600 // Refresh frequency of cookies |
| 186 | + } |
| 187 | + }, |
| 188 | + { |
| 189 | + "name": "merkleId", |
| 190 | + "params": { |
| 191 | + "endpoint": "https://test_endpoint/", |
| 192 | + "vendor": "sdfg", |
| 193 | + "sv_cid": "dfg", |
| 194 | + "sv_pubid": "xcv", |
| 195 | + "sv_domain": "zxv" |
| 196 | + }, |
| 197 | + "storage": { |
| 198 | + "type": "html5", |
| 199 | + "name": "merkleId", |
| 200 | + "expires": 30 |
| 201 | + } |
| 202 | + }, |
| 203 | + { |
| 204 | + "name": "parrableId", |
| 205 | + "params": { |
| 206 | + // change to Parrable Partner Client ID(s) you received from the Parrable Partners you are using |
| 207 | + "partner": "30182847-e426-4ff9-b2b5-9ca1324ea09b" |
| 208 | + } |
| 209 | + }, |
| 210 | + { |
| 211 | + "name": "pubCommonId", |
| 212 | + "storage": { |
| 213 | + "type": "cookie", |
| 214 | + "name": "pubcid", |
| 215 | + "expires": 365 |
| 216 | + } |
| 217 | + // value: { |
| 218 | + // foo: '9879878907987', |
| 219 | + // bar:'93939' |
| 220 | + // } |
| 221 | + }, |
| 222 | + { |
| 223 | + "name": "identityLink", |
| 224 | + "params": { |
| 225 | + "pid": "14" // Set your real identityLink placement ID here |
| 226 | + // use3P: false // true/false - If you want to use 3P endpoint to retrieve envelope. If you do not set this property to true, 3p endpoint will not be fired. By default this property is undefined and 3p request will not be fired. |
| 227 | + }, |
| 228 | + "storage": { |
| 229 | + "type": "cookie", |
| 230 | + "name": "idl_env", |
| 231 | + "expires": 30 |
| 232 | + } |
| 233 | + }, |
| 234 | + { |
| 235 | + "name": "lotamePanoramaId" |
| 236 | + }, |
| 237 | + { |
| 238 | + "name": "liveIntentId", |
| 239 | + "params": { |
| 240 | + "publisherId": "9896876" |
| 241 | + }, |
| 242 | + "storage": { |
| 243 | + "type": "cookie", |
| 244 | + "name": "_li_pbid", |
| 245 | + "expires": 28 |
| 246 | + } |
| 247 | + }, |
| 248 | + { |
| 249 | + "name": "zeotapIdPlus" |
| 250 | + }, |
| 251 | + { |
| 252 | + "name": "hadronId", |
| 253 | + "storage": { |
| 254 | + "type": "cookie", |
| 255 | + "name": "hadronId", |
| 256 | + "expires": 28 |
| 257 | + } |
| 258 | + }, |
| 259 | + { |
| 260 | + "name": "quantcastId" |
| 261 | + }, |
| 262 | + { |
| 263 | + "name": "criteo" |
| 264 | + }, |
| 265 | + { |
| 266 | + "name": "amxId", |
| 267 | + "storage": { |
| 268 | + "type": "html5", |
| 269 | + "name": "amxId", |
| 270 | + "expires": 14 |
| 271 | + } |
| 272 | + }, |
| 273 | + { |
| 274 | + "name": "uid2", |
| 275 | + "params": { |
| 276 | + "uid2Token": { |
| 277 | + "advertising_token": "example token", |
| 278 | + "refresh_token": "aslkdjaslkjdaslkhj", |
| 279 | + "identity_expires": Date.now() + 60*1000, |
| 280 | + "refresh_from": Date.now() - 10*1000, |
| 281 | + "refresh_expires": Date.now() + 12*60*60*1000, |
| 282 | + "refresh_response_key": null |
| 283 | + } |
| 284 | + } |
| 285 | + }, |
| 286 | + { |
| 287 | + "name": "euid", |
| 288 | + "params": { |
| 289 | + "euidApiBase": "https://integ.euid.eu", // Omit this setting for production |
| 290 | + "euidToken": { |
| 291 | + "advertising_token": "advertising token goes here", |
| 292 | + "refresh_token": "refresh token goes here", |
| 293 | + "identity_expires": Date.now() + 60*1000, // These timestamps should be from the token generate response |
| 294 | + "refresh_from": Date.now() - 10*1000, |
| 295 | + "refresh_expires": Date.now() + 12*60*60*1000, |
| 296 | + "refresh_response_key": "refresh key goes here" |
| 297 | + } |
| 298 | + } |
| 299 | + }, |
| 300 | + { |
| 301 | + "name": "imuid", |
| 302 | + "params": { |
| 303 | + "cid": 5126 // Set your Intimate Merger Customer ID here for production |
| 304 | + } |
| 305 | + }, |
| 306 | + { |
| 307 | + "name": "dacId" |
| 308 | + }, |
| 309 | + { |
| 310 | + "name": "gravitompId" |
| 311 | + } |
| 312 | + ], |
| 313 | + "syncDelay": 5000, |
| 314 | + "auctionDelay": 1000 |
| 315 | + } |
| 316 | + }); |
| 317 | + pbjs.addAdUnits(adUnits); |
| 318 | + pbjs.requestBids({ |
| 319 | + bidsBackHandler: sendAdserverRequest |
| 320 | + }); |
| 321 | + }); |
| 322 | + |
| 323 | + function sendAdserverRequest() { |
| 324 | + if (pbjs.adserverRequestSent) return; |
| 325 | + pbjs.adserverRequestSent = true; |
| 326 | + googletag.cmd.push(function () { |
| 327 | + pbjs.que.push(function () { |
| 328 | + pbjs.setTargetingForGPTAsync(); |
| 329 | + googletag.pubads().refresh(); |
| 330 | + }); |
| 331 | + }); |
| 332 | + } |
| 333 | + |
| 334 | + setTimeout(function () { |
| 335 | + sendAdserverRequest(); |
| 336 | + }, FAILSAFE_TIMEOUT); |
| 337 | + </script> |
| 338 | + |
| 339 | + <script> |
| 340 | + (function () { |
| 341 | + var gads = document.createElement('script'); |
| 342 | + gads.async = true; |
| 343 | + gads.type = 'text/javascript'; |
| 344 | + gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js'; |
| 345 | + var node = document.getElementsByTagName('script')[0]; |
| 346 | + node.parentNode.insertBefore(gads, node); |
| 347 | + })(); |
| 348 | + </script> |
| 349 | + |
| 350 | + <script> |
| 351 | + googletag.cmd.push(function () { |
| 352 | + googletag.defineSlot('/112115922/FL_PB_MedRect', [[300, 250], [300, 600], [728, 90]], 'test-div').addService(googletag.pubads()); |
| 353 | + googletag.pubads().enableSingleRequest(); |
| 354 | + googletag.enableServices(); |
| 355 | + }); |
| 356 | + </script> |
| 357 | +</head> |
| 358 | + |
| 359 | +<body> |
| 360 | + <h2>User ID Modules Example</h2> |
| 361 | + |
| 362 | + <h4>Generated EIDs</h4> |
| 363 | + <script> |
| 364 | + pbjs.que.push(function () { |
| 365 | + var idsDiv = document.getElementById('ids-div'); |
| 366 | + idsDiv.innerHTML = JSON.stringify(pbjs.getUserIdsAsEids(), null, ' '); |
| 367 | + }); |
| 368 | + </script> |
| 369 | + <pre id="ids-div" style="border:1px solid #333; padding:5px; overflow: scroll"></pre> |
| 370 | + |
| 371 | + <h4>Ad Slot</h4> |
| 372 | + <div id="test-div" style="border:1px solid #333; padding:5px;"> |
| 373 | + <script> |
| 374 | + googletag.cmd.push(function () { googletag.display('test-div'); }); |
| 375 | + </script> |
| 376 | + </div> |
| 377 | +</body> |
| 378 | + |
| 379 | +</html> |
0 commit comments