console.log("THETA DISPLAY"); let oneman300x600atfw = {} oneman300x600atfw.pel = document.createElement('script') oneman300x600atfw.pel.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js' oneman300x600atfw.pel.async = true document.head.appendChild(oneman300x600atfw.pel) oneman300x600atfw.pel = document.createElement('script') oneman300x600atfw.pel.src = `https://static.thetamedia.gr/prebid.js?t=1721893585` oneman300x600atfw.pel.async = true document.head.appendChild(oneman300x600atfw.pel) oneman300x600atfw.PREBID_TIMEOUT = 1500; oneman300x600atfw.FAILSAFE_TIMEOUT = 3000; oneman300x600atfw._theta_head = window.parent.document.head || window.parent.document.getElementsByTagName('head')[0] oneman300x600atfw.conf = JSON.parse('{"mediaTypes":{"banner":{"sizes":[300,600]}},"bidders":[{"bidder":"adform","params":{"mid":1485511}}]}'.replaceAll('"', '"')) oneman300x600atfw.sellerId = "86" oneman300x600atfw.gam = true oneman300x600atfw.passbackuri = "https://thetamarketplace.com/passback/oneman300x600atfw" oneman300x600atfw.hituri = "https://thetamarketplace.com/hit/oneman300x600atfw/host/false" oneman300x600atfw.dmp = false oneman300x600atfw.position = 'thetadisplay' if(typeof oneman300x600atfw.conf.position !== "undefined") oneman300x600atfw.position = oneman300x600atfw.conf.position oneman300x600atfw.adUnits = [ { code: 'thetadisplay', mediaTypes: oneman300x600atfw.conf.mediaTypes, bids: oneman300x600atfw.conf.bidders } ]; var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; oneman300x600atfw.passback = function() { var script_tag = document.createElement('script') script_tag.src = oneman300x600atfw.passbackuri script_tag.async = true script_tag.defer = true oneman300x600atfw.passbackins.appendChild(script_tag) } oneman300x600atfw.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: oneman300x600atfw.sellerId, hp:1 } ] } }, userSync: { iframeEnabled: true, filterSettings: { iframe: { bidders: '*', filter: 'include', }, }, userIds: [], auctionDelay: 1000, syncDelay: 3000, syncEnabled: true } } if(window.parent.document !== document) { oneman300x600atfw.passbackins = document.body oneman300x600atfw.ins = document } else { oneman300x600atfw.passbackins = document.currentScript.parentElement let t = document.createElement('iframe') t.setAttribute('frameBorder', 0) t.setAttribute('id', `thetadisplay_oneman300x600atfw`) t.setAttribute('style', 'width:330px; height: 600px;') document.currentScript.parentElement.append(t) oneman300x600atfw.ins = t.contentWindow.document; oneman300x600atfw.passbackins = t.contentWindow.document.body; } oneman300x600atfw.initAdserver = function() { if (oneman300x600atfw.initAdserverSet) return; oneman300x600atfw.initAdserverSet = true; let adServerTargeting = pbjs.getAdserverTargetingForAdUnitCode('thetadisplay'); // If any bidders return any creatives if (adServerTargeting && adServerTargeting['hb_adid']) { pbjs.renderAd(oneman300x600atfw.ins, adServerTargeting['hb_adid']); } else { oneman300x600atfw.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') { oneman300x600atfw.passback() } else { pbjs.que.push(function() { pbjs.addAdUnits(oneman300x600atfw.adUnits); pbjs.setConfig(oneman300x600atfw.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: oneman300x600atfw.PREBID_TIMEOUT, bidsBackHandler: oneman300x600atfw.initAdserver }); }); } } else { fetch(oneman300x600atfw.hituri.replace('/host', '/' + window.location.host), { method: 'GET', }) oneman300x600atfw.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') { oneman300x600atfw.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]) { oneman300x600atfw.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]) { oneman300x600atfw.pbjsconfig.userSync.userIds.push({ name: "lotamePanoramaId", params: { clientId: 17773 } }) } oneman300x600atfw.pbjsconfig.userSync.userIds.push({ name: "sharedId", storage: { name: "_sharedID", type: "html5", expires: 30 } }) oneman300x600atfw.pbjsconfig.userSync.userIds.push({ name: "criteo" }) } pbjs.que.push(function() { pbjs.addAdUnits(oneman300x600atfw.adUnits); pbjs.setConfig(oneman300x600atfw.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: oneman300x600atfw.PREBID_TIMEOUT, bidsBackHandler: oneman300x600atfw.initAdserver }); }); setTimeout(function() { oneman300x600atfw.initAdserver(); }, oneman300x600atfw.FAILSAFE_TIMEOUT); if(oneman300x600atfw.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) oneman300x600atfw._theta_head.appendChild(ns) }) }) .catch((err) => { console.log(`${err.name}: ${err.message}`); }); } } } }); }