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