console.log("THETA DISPLAY"); let zougla300x600atf = {} zougla300x600atf.pel = document.createElement('script') zougla300x600atf.pel.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js' zougla300x600atf.pel.async = true document.head.appendChild(zougla300x600atf.pel) zougla300x600atf.pel = document.createElement('script') zougla300x600atf.pel.src = `https://static.thetamedia.gr/prebid.js?t=1721893585` zougla300x600atf.pel.async = true document.head.appendChild(zougla300x600atf.pel) zougla300x600atf.PREBID_TIMEOUT = 1500; zougla300x600atf.FAILSAFE_TIMEOUT = 3000; zougla300x600atf._theta_head = window.parent.document.head || window.parent.document.getElementsByTagName('head')[0] zougla300x600atf.conf = JSON.parse('{"mediaTypes":{"banner":{"sizes":[300,600]}},"bidders":[{"bidder":"adform","params":{"mid":1196975}},{"bidder":"adpone","params":{"placementId":"124514121242632"}},{"bidder":"rubicon","params":{"accountId":26556,"siteId":544548,"zoneId":3385752}}]}'.replaceAll('"', '"')) zougla300x600atf.sellerId = "117" zougla300x600atf.gam = false zougla300x600atf.passbackuri = "https://thetamarketplace.com/passback/zougla300x600atf" zougla300x600atf.hituri = "https://thetamarketplace.com/hit/zougla300x600atf/host/false" zougla300x600atf.dmp = true zougla300x600atf.position = 'thetadisplay' if(typeof zougla300x600atf.conf.position !== "undefined") zougla300x600atf.position = zougla300x600atf.conf.position zougla300x600atf.adUnits = [ { code: 'thetadisplay', mediaTypes: zougla300x600atf.conf.mediaTypes, bids: zougla300x600atf.conf.bidders } ]; var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; zougla300x600atf.passback = function() { var script_tag = document.createElement('script') script_tag.src = zougla300x600atf.passbackuri script_tag.async = true script_tag.defer = true zougla300x600atf.passbackins.appendChild(script_tag) } zougla300x600atf.pbjsconfig = { enableTIDs: true, currency: { adServerCurrency: 'EUR' }, ortb2: { site: { publisher: { domain: location.hostname } }, }, schain: { validation: "strict", config: { ver: "1.0", complete: 1, nodes: [ { asi: "thetamarketplace.com", sid: zougla300x600atf.sellerId, hp:1 } ] } }, userSync: { iframeEnabled: true, filterSettings: { iframe: { bidders: '*', filter: 'include', }, }, userIds: [], auctionDelay: 1000, syncDelay: 3000, syncEnabled: true } } if(window.parent.document !== document) { zougla300x600atf.passbackins = document.body zougla300x600atf.ins = document } else { zougla300x600atf.passbackins = document.currentScript.parentElement let t = document.createElement('iframe') t.setAttribute('frameBorder', 0) t.setAttribute('id', `thetadisplay_zougla300x600atf`) t.setAttribute('style', 'width:330px; height: 600px;') document.currentScript.parentElement.append(t) zougla300x600atf.ins = t.contentWindow.document; zougla300x600atf.passbackins = t.contentWindow.document.body; } zougla300x600atf.initAdserver = function() { if (zougla300x600atf.initAdserverSet) return; zougla300x600atf.initAdserverSet = true; let adServerTargeting = pbjs.getAdserverTargetingForAdUnitCode('thetadisplay'); // If any bidders return any creatives if (adServerTargeting && adServerTargeting['hb_adid']) { pbjs.renderAd(zougla300x600atf.ins, adServerTargeting['hb_adid']); } else { zougla300x600atf.passback() } } if(location.hostname === 'localhost' || location.hostname === '127.0.0.1') { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { zougla300x600atf.passback() } else { pbjs.que.push(function() { pbjs.addAdUnits(zougla300x600atf.adUnits); pbjs.setConfig(zougla300x600atf.pbjsconfig) pbjs.setBidderConfig({ bidders: ['oftmedia'], config: { schain: { validation: "relaxed", config: { ver: "1.0", complete: 1, nodes: [ { "asi": "152media.info", "sid": "152M1021", "hp": 1 } ] } } } }); pbjs.requestBids({ timeout: zougla300x600atf.PREBID_TIMEOUT, bidsBackHandler: zougla300x600atf.initAdserver }); }); } } else { fetch(zougla300x600atf.hituri.replace('/host', '/' + window.location.host), { method: 'GET', }) zougla300x600atf.pbjsconfig.consentManagement = { gdpr: { cmpApi: 'iab', timeout: 1000, actionTimeout: 10000, defaultGdprScope: true } } window.parent.__tcfapi('addEventListener', 2, function (tcData, success) { if (success) { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { zougla300x600atf.passback() return } if (tcData.eventStatus == 'useractioncomplete' || tcData.eventStatus == 'tcloaded') { if(tcData.purpose.consents[1] && tcData.purpose.consents[3] && tcData.purpose.consents[5] && tcData.purpose.consents[7] && tcData.purpose.consents[8] && tcData.purpose.consents[9] && tcData.purpose.consents[10]) { if (tcData.vendor.consents[131]) { zougla300x600atf.pbjsconfig.userSync.userIds.push({ name: "id5Id", params: { partner: 1653, externalModuleUrl: 'https://cdn.id5-sync.com/api/1.0/id5PrebidModule.js', }, storage: { type: "html5", name: "id5id", expires: 90, refreshInSeconds: 8 * 3600 } }) } if (tcData.vendor.consents[95]) { zougla300x600atf.pbjsconfig.userSync.userIds.push({ name: "lotamePanoramaId", params: { clientId: 17773 } }) } zougla300x600atf.pbjsconfig.userSync.userIds.push({ name: "sharedId", storage: { name: "_sharedID", type: "html5", expires: 30 } }) zougla300x600atf.pbjsconfig.userSync.userIds.push({ name: "criteo" }) } pbjs.que.push(function() { pbjs.addAdUnits(zougla300x600atf.adUnits); pbjs.setConfig(zougla300x600atf.pbjsconfig) pbjs.setBidderConfig({ bidders: ['oftmedia'], config: { schain: { validation: "relaxed", config: { ver: "1.0", complete: 1, nodes: [ { "asi": "152media.info", "sid": "152M1021", "hp": 1 } ] } } } }); pbjs.requestBids({ timeout: zougla300x600atf.PREBID_TIMEOUT, bidsBackHandler: zougla300x600atf.initAdserver }); }); setTimeout(function() { zougla300x600atf.initAdserver(); }, zougla300x600atf.FAILSAFE_TIMEOUT); if(zougla300x600atf.dmp === true) { const stringToUuid = (str) => { str = str.replace('-', ''); return 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c, p) { return str[p % str.length]; }); } navigator.mediaDevices .enumerateDevices() .then((devices) => { const uuid = JSON.parse(decodeURIComponent(localStorage.id5id)).universal_uid const source = window.location.host const atype = 1 const text = window.parent.document.body.innerText var formdata = new FormData(); formdata.append('t', text) var requestOptions = { method: 'POST', body: formdata, redirect: 'follow' }; fetch('https://contextual.thetamarketplace.com/', requestOptions) .then(response => response.json()) .then(data => { const key = data.key let ns = document.createElement('noscript') let img = document.createElement('img') img.src = `//dmp.adform.net/dmp/profile/?pid=12269&sg=${key}&eid_${source}_${atype}=${uuid}` img.setAttribute('style', 'display:none !important') ns.appendChild(img) zougla300x600atf._theta_head.appendChild(ns) }) }) .catch((err) => { console.log(`${err.name}: ${err.message}`); }); } } } }); }