console.log("=== OPTILOAD CONFIG: 20190403 ==="); console.log("=== PB/OPTILOAD 1.40.0/1.2.0 ==="); /* window.Adomik = window.Adomik || {}; Adomik.randomAdGroup = function () { var rand = Math.random(); switch (false) { case !(rand < 0.09): return "ad_ex" + (Math.floor(100 * rand)); case !(rand < 0.10): return "ad_bc"; default: return "ad_opt"; } }; */ var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; googletag.cmd.push(function () { googletag.pubads().enableSingleRequest(); googletag.pubads().disableInitialLoad(); googletag.pubads().collapseEmptyDivs(true); //googletag.pubads().setTargeting("advelvet",(Math.floor(Math.random() * 20) + 1) + ""); googletag.enableServices(); }); var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; var Optiload = {}; Optiload.adUnits = (function ($) { Optiload.isMobile = function () { return $(window).width() < 980; } var adUnits = []; adUnits[0] = { name: '/5966054/Tennisworld/Tennisworld_Masthead', sizes: [[1,1],[300, 100],[320, 100],[728,90],[970, 90], [970, 250]], lazy: false, mappings:{ desktop: [[1,1],[728,90],[970, 90], [970, 250]] //mobile: [[1,1]] }, hb: { sizes: [[970, 250], [728, 90]], bids:[ { bidder:'adform', params:{ mid: '557835'} }, { bidder: 'appnexusAst', params: { placementId: '13190548'} }, { bidder: 'ix', params: { siteId: '357010', size: [970, 250] } }, { bidder: 'ix', params: { siteId: '357010', size: [728, 90] } }, { bidder: 'openx', params: { unit: '539874268', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Masthead_970x250@970x250' } // }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Masthead_728x90@728x90' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918380", sizes: [2,57]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58989} } ] } // hbmobile:{ // sizes: [[300, 100]], // bids:[ // { // bidder:'adform', // params:{ mid: '557836'} // }, // { // bidder: 'appnexusAst', // params: { placementId: '13190548'} // }, // { // bidder: 'ix', // params: { // siteId: '357010', // size: [300, 100] // } // }, // { // bidder: 'openx', // params: { unit: '539874268', delDomain: 'evolution-d.openx.net'} // }, // // { // // bidder: 'pubmatic', // // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Masthead_300x100@300x100' } // // }, // { // bidder: 'rubicon', // params: { accountId: "17322", siteId:"188312", zoneId: "918610", sizes: [19]} // }, // { // bidder: 'smartadserver', // params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58990} // } // ] // } }; adUnits[3] = { name: '/5966054/Tennisworld/Tennisworld_ATF', sizes: [[300, 250],[300, 400],'fluid',[320, 480]], lazy: false, mappings:{ desktop: [[300,250],[300, 400],'fluid'], mobile: [[300,250],'fluid',[320, 480]] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557821'} }, { bidder: 'appnexusAst', params: { placementId: '13190550'} }, { bidder: 'ix', params: { siteId: '358045', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874273', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_ATF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918382", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58998} } ] }, hbmobile:{ sizes: [[300, 250],[320, 480]], bids:[ { bidder:'adform', params:{ mid: '557821'} }, { bidder: 'appnexusAst', params: { placementId: '13190550'} }, { bidder: 'ix', params: { siteId: '358045', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358045', size: [320, 480] } }, { bidder: 'openx', params: { unit: '539874273', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_ATF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918612", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58999} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[4] = { name: '/5966054/Tennisworld/Tennisworld_ATF2', sizes: [[300, 250],[300, 400],'fluid',[320, 480]], lazy: true, mappings:{ desktop: [[300,250],[300, 400],'fluid'], mobile: [[300,250],'fluid',[320, 480]] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557822'} }, { bidder: 'appnexusAst', params: { placementId: '13190671'} }, { bidder: 'ix', params: { siteId: '358045', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874273', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_ATF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918384", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58998} } ] }, hbmobile:{ sizes: [[300, 250],[320, 480]], bids:[ { bidder:'adform', params:{ mid: '557822'} }, { bidder: 'appnexusAst', params: { placementId: '13190671'} }, { bidder: 'ix', params: { siteId: '358045', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358045', size: [320, 480] } }, { bidder: 'openx', params: { unit: '539874273', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_ATF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918614", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58999} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[7] = { name: '/5966054/Tennisworld/Tennisworld_Intext', sizes: [[300, 250],[300, 400],'fluid',[320, 480]], lazy: true, offset: 250, mappings:{ desktop: [[300,250],[300, 400],'fluid'], mobile: [[300,250],'fluid',[320, 480]] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557823'} }, { bidder: 'appnexusAst', params: { placementId: '13190672'} }, { bidder: 'ix', params: { siteId: '358046', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874275', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_intext_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918386", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58993} } ] }, hbmobile:{ sizes: [[300, 250],[320, 480]], bids:[ { bidder:'adform', params:{ mid: '557823'} }, { bidder: 'appnexusAst', params: { placementId: '13190672'} }, { bidder: 'ix', params: { siteId: '358046', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358046', size: [320, 480] } }, { bidder: 'openx', params: { unit: '539874275', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_intext_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918616", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58994} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[8] = { name: '/5966054/Tennisworld/Tennisworld_BTF', sizes: [[300, 250],'fluid',[320, 480]], lazy: true, mappings:{ desktop: [[300,250],'fluid'], mobile: [[300,250],'fluid',[320, 480]] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557826'} }, { bidder: 'appnexusAst', params: { placementId: '13190674'} }, { bidder: 'ix', params: { siteId: '358047', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874276', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_BTF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918388", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:59000} } ] }, hbmobile:{ sizes: [[300, 250],[320, 480]], bids:[ { bidder:'adform', params:{ mid: '557826'} }, { bidder: 'appnexusAst', params: { placementId: '13190674'} }, { bidder: 'ix', params: { siteId: '358047', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358047', size: [320, 480] } }, { bidder: 'openx', params: { unit: '539874276', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_BTF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918620", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:59001} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[9] = { name: '/5966054/Tennisworld/Tennisworld_BTF2', sizes: [[300, 250],'fluid',[320, 480]], lazy: true, mappings:{ desktop: [[300,250],'fluid'], mobile: [[300,250],'fluid',[320, 480]] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557828'} }, { bidder: 'appnexusAst', params: { placementId: '13190675'} }, { bidder: 'ix', params: { siteId: '358047', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874276', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_BTF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918390", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:59000} } ] }, hbmobile:{ sizes: [[300, 250],[320, 480]], bids:[ { bidder:'adform', params:{ mid: '557828'} }, { bidder: 'appnexusAst', params: { placementId: '13190675'} }, { bidder: 'ix', params: { siteId: '358047', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358047', size: [320, 480] } }, { bidder: 'openx', params: { unit: '539874276', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_box_BTF_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918622", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:59001} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[12] = { name: '/5966054/Tennisworld/Tennisworld_Top_side', sizes: [[300, 250],[300, 600],'fluid'], lazy: false, mappings:{ desktop: [[300,250],[300, 600],'fluid'], mobile: [[300,250],'fluid'] }, hb: { sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557829'} }, { bidder: 'appnexusAst', params: { placementId: '13190676'} }, { bidder: 'ix', params: { siteId: '358048', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874278', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Top_Side_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918392", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58998} } ] }, hbmobile:{ sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557829'} }, { bidder: 'appnexusAst', params: { placementId: '13190676'} }, { bidder: 'ix', params: { siteId: '358048', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874278', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Top_Side_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918624", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58999} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[15] = { name: '/5966054/Tennisworld/Tennisworld_Side_Sticky', sizes: [[300, 250],[160,600],[300,600],'fluid'], lazy: true, mappings:{ desktop: [[300, 250],[160,600],[300,600],'fluid'], mobile: [[300, 250],'fluid'] }, hb: { sizes: [[300, 250],[300,600]], bids:[ { bidder:'adform', params:{ mid: '557830'} }, { bidder: 'appnexusAst', params: { placementId: '13190677'} }, { bidder: 'ix', params: { siteId: '358049', size: [300, 250] } }, { bidder: 'ix', params: { siteId: '358049', size: [300, 600] } }, { bidder: 'openx', params: { unit: '539874280', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Side_Sticky_300x250@300x250' } // }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Side_Sticky_300x600@300x600' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918396", sizes: [10,15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58995} } ] }, hbmobile:{ sizes: [[300, 250]], bids:[ { bidder:'adform', params:{ mid: '557830'} }, { bidder: 'appnexusAst', params: { placementId: '13190677'} }, { bidder: 'ix', params: { siteId: '358049', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539874280', delDomain: 'evolution-d.openx.net'} }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'Tennisworlditalia_Side_Sticky_300x250@300x250' } // }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918628", sizes: [15]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58994} }, { bidder:'widespace', params:{ sid: '847061a9-6170-486d-9705-6da106fe1e2b'} } ] } }; adUnits[16] = { name: '/5966054/Tennisworld/Tennisworld_Floorad', sizes: [[970, 90], [728, 90], [300, 100], [320, 100], [1,1],[1,4]], mappings:{ desktop: [[970, 90], [728, 90],[1,1],[1,4]], mobile: [[300,100],[320,100],[1,1],[1,4]] }, hb: { sizes: [[728, 90],[970,90]], bids: [ { bidder: 'adform', params: { mid: '557831'} }, { bidder: 'appnexusAst', params: { placementId: '13190678'} }, { bidder: 'ix', params: { siteId: '358050', size: [728, 90] } }, { bidder: 'ix', params: { siteId: '358050', size: [970, 90] } }, { bidder: 'openx', params: { unit: '539874282', delDomain: 'evolution-d.openx.net'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188310", zoneId: "918398", sizes: [2,55]} }/*, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58991} }*/ ] }, hbmobile: { sizes: [[300, 100]], bids: [ { bidder: 'adform', params: {mid: '557849'} }, { bidder: 'appnexusAst', params: { placementId: '13190679'} }, { bidder: 'ix', params: { siteId: '358050', size: [300, 100] } }, { bidder: 'openx', params: { unit: '539874282', delDomain: 'evolution-d.openx.net'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId:"188312", zoneId: "918630", sizes: [19]} }, { bidder: 'smartadserver', params: {siteId: 235069, domain:'https://prg.smartadserver.com',pageId:934159, formatId:58992} } ] } }; adUnits[17] = { name: '/5966054/Tennisworld/Tennisworld_Skin', sizes: [[1, 1],[1,3],[1800,1000]], mappings:{ desktop: [[1,1],[1,3],[1800,1000]], mobile: [[1,1],[1,3]] } }; return adUnits; }(jQuery)); (function ($, Optiload) { Optiload.bus = $({}); Optiload.sm = null; var cmp_loaded = false; var prebid_loaded = false; var optiload_loaded = false; include_js("https://assets.evolutionadv.it/confiant/confiant.js", function () {}); (function (window) { window.__cmpAcceptOnScroll = true; window.__cmp = (function () { var commandQueue = []; var cmp = function (command, parameter, callback) { commandQueue.push({ command: command, parameter: parameter, callback: callback }); }; cmp.commandQueue = commandQueue; cmp.config = { forceLocale: "it", localization: { it: { intro: { // title: 'Money.it', title:" ", description: "

Questo sito utilizza pubblicitĂ  e servizi basati su cookie.\ Accetta l'utilizzo dei cookie sul tuo dispositivo per consentire una maggiore personalizzazione di pubblicitĂ  e contenuti del sito.\ Per maggiori informazioni visita la nostra privacy policy.

", acceptAll: "ACCETTA", } } }, repromptOptions: { fullConsentGiven: 360, someConsentGiven: 1, noConsentGiven: 0, }, storeConsentGlobally: true, globalConsentLocation: '//cdn.digitrust.mgr.consensu.org/1/portal.html', storePublisherData: false, testingMode: 'normal', geoIPVendor: '//cdn.digitrust.mgr.consensu.org/1/geoip.json', layout: 'footer' }; return cmp; }()); })(window); window.__cmp('renderCmpIfNeeded'); include_js("https://assets.evolutionadv.it/cmp/adform/1.6.2/cmp.complete.bundle.js", function () { //1.1.0 // var css = ".footerV2_footerV2--2gaTb, .footer_footer--2VRZS{display:none !important;}\ // .popupFooter_content--1E1tr{background:rgba(255,255,255,0.8)}\ // div.popupFooter_overlay--2OhI-{background-color: rgba(0,0,0,0)!important;}\ // .app_gdpr--3hGmb{font-size:13px!important;}\ // div.introV2_intro--2-0Kv .introV2_title--20c_L{padding:0!important;}\ // button.button_button--2xwHu, input[type=button].button_button--2xwHu{padding:5px!important;}\ // div.introV2_options--3zFqj button.button_button--2xwHu.introV2_acceptAll--3TK9h{padding:7px!important}\ // @media(max-width:767px){\ // .popupFooter_content--1E1tr{height:auto!important;width:100%!important;}\ // div.introV2_intro--2-0Kv .introV2_contentMessage--25C9n, div.introV2_intro--2-0Kv{padding:0!important;}\ // }", var css = ".footerV2_footerV2--13OCL, .footer_footer--3uVCQ{display:none !important;}\ .popupFooter_content--h3gli{background:rgba(255,255,255,0.8)}\ div.popupFooter_overlay--3JqqW{background-color: rgba(0,0,0,0)!important;}\ .app_gdpr--2k2uB{font-size:13px!important;}\ div.introV2_intro--38lAX .introV2_title--2n6j3{padding:0!important;}\ button.button_button--lgX0P, input[type=button].button_button--lgX0P{padding:5px!important;}\ div.introV2_options--12wQO button.button_button--lgX0P.introV2_acceptAll--3PxeJ{padding:7px!important}\ @media(max-width:767px){\ .popupFooter_content--h3gli{height:auto!important;width:100%!important;}\ div.introV2_intro--38lAX .introV2_contentMessage--2yLOV, div.introV2_intro--38lAX{padding:0!important;}\ }", head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; // @ts-ignore if (style.styleSheet) { // @ts-ignore style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); // function getConsent() { // @ts-ignore window.__cmp('getConsentData', null, function (result) { // if (result) { cmp_loaded = true; startOptiload(); // } else { // setTimeout(getConsent, 1000); // } }); // } // getConsent(); }); // @ts-ignore window.__cmp('addEventListener', 'cmpReady', function (response) { console.log("CMP: ready"); $(window).on("scroll", acceptOnScroll); var button = ".button_button--lgX0P.introV2_acceptAll--3PxeJ "; $(".popupFooter_overlay--3JqqW").on("click",acceptOnClick); function acceptOnScroll() { // @ts-ignore if ($(button).length > 0 && $(button).is(":visible") && window.__cmpAcceptOnScroll){ // @ts-ignore window.__cmpAcceptOnScroll = false; $(button).trigger("click"); console.log("CMP: accept on scroll"); $(window).off("scroll", acceptOnScroll); $(".popupFooter_overlay--3JqqW").off("click",acceptOnClick); } } function acceptOnClick() { // @ts-ignore if (window.__cmpAcceptOnScroll){ // @ts-ignore window.__cmpAcceptOnScroll = false; $(button).trigger("click"); console.log("CMP: accept on click"); $(window).off("scroll", acceptOnScroll); $(".popupFooter_overlay--2OhI-").off("click",acceptOnClick); } } setTimeout(function(){ $(window).off("scroll", acceptOnScroll);},60000); // var hasHandler = false; // var retries = 0; // function findButton() { // if ($(button).length > 0 && $(button).is(":visible") && // !hasConsentInfo && !hasHandler) { // console.log("CMP: attach handler"); // $(window).on("scroll", acceptOnScroll); // hasHandler = true; // } else { // retries++; // if (retries < 60) { // setTimeout(findButton, 1000); // } // } // } // findButton(); window.__cmp('addEventListener', 'consentStringUpdated', function (result) { window.__cmp('getVendorConsents', null, function (result) { var consent = result.purposeConsents["1"] && result.purposeConsents["2"] && result.purposeConsents["3"]; console.log("CMP: Consent 123 => " + consent); var yesNo = consent ? "si" : "no"; }); }); }); window.__cmp('addEventListener', 'onSubmit', function (response) { $('html,body').animate({ scrollTop: 0 }, 'slow'); }); include_js("https://assets.evolutionadv.it/prebid/1.40.0/prebid.min.js", function () { pbjs.setConfig({ cache: { url: "https://prebid.adnxs.com/pbc/v1/cache" }, // "currency": { // "adServerCurrency": "JPY", /* Enables currency feature -- loads the rate file */ // "conversionRateFile": "url" // Allows the publisher to override the default rate file // }, "debug": false, // Previously `logging` endpoint: "https://prebid.adnxs.com/pbs/v1/auction", syncEndpoint: "https://prebid.adnxs.com/pbs/v1/cookie_sync", // "s2sConfig" : { // accountId : 'ae2fd2d6-deab-4262-bf76-bc7ef4ab7d87', //string:required: account ID obtained in step 1 // enabled : true, //boolean:required: enables s2s - default false // bidders : ['pubmatic','rubicon'], //array[string]:required: of bidder codes to enable S2S. // //Note these must have been including in the Prebid.js build from Step 2. // timeout : 600, //number:optional timeout in ms for bidders called via the S2S endpoint. // //default value is 1000 // //adapter : 'prebidServer', //string:optional: Adapter code for S2S code. Defaults to 'prebidServer' // cookieSet : true //boolean:optional: If 'false' (not recommended), opt out of link rewriting // //and cookie-setting that allow a persistent cookie for improved cookie // //match rates. // }, consentManagement: { cmpApi: 'iab', timeout: 60000, allowAuctionWithoutConsent: false }, "priceGranularity": "high", "enableSendAllBids": true, // Default will be `true` as of 1.0 "bidderSequence": "random", "bidderTimeout": 1200, // Default for all requests. "publisherDomain": "tennisworlditalia.com", // Used for SafeFrame creative. //By default, Prebid.js version 0.34.0+ turns off user syncing through iframes. //OpenX strongly recommends enabling user syncing through iframes. //This functionality improves DSP user match rates and increases the OpenX bid rate and bid price. // Be sure to call pbjs.setConfig() only once. "userSync": { iframeEnabled: true, enabledBidders: ['pubmatic','openx'], syncDelay: 6000 }, "cookieSyncDelay": 100 }); prebid_loaded = true; startOptiload(); }); include_js("https://assets.evolutionadv.it/optiload/1.2.0/optiload.min.js", function () { optiload_loaded = true; startOptiload(); }); function include_js(file, callback) { var js = null; var loaded = false; var head = document.getElementsByTagName('head')[0]; js = document.createElement('script'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', file); head.appendChild(js); js.onreadystatechange = function () { if (js.readyState == 'complete' && !loaded) { loaded = true; if (callback) { callback(); } } } js.onload = function () { if (!loaded) { loaded = true; if (callback) { callback(); } } } return false; } function startOptiload() { if (!cmp_loaded || !prebid_loaded || !optiload_loaded) { return; } Optiload.sm = new slotManager.SlotManager(Optiload.adUnits, { intervalInactivity: 50 }); $(function () { Optiload.bus.trigger("optiload_ready"); //se le adUnit sono caricate da fuori commento questo metodo loadAdUnits(); loadFloorad(16); //idFloorad //loadSpotx(); loadSkin(17); // idSkin loadNuggAd(); setTimeout(function findDivs() { var $ads = $('#loading_next'); if ($ads && $ads.length > 0) { loadBridInStreamMobile(); } else { setTimeout(findDivs, 1000); } }, 1000); }); } function loadNuggAd(){ var contentnugg = top.location.href + ','; var metas = document.getElementsByTagName('meta'); for (var i=0; i ') .insertAfter("#loading_next"); //.insertBefore('.contenitore_articolo:first'); $bp("brid-instream-mobile", { "id": "13432", "width": "16", "height": "9", "autoplayStickyAdOnly": true, "video": { "source": { "src": "https://www.tennisworlditalia.com/video/3_colpi_passante_in_corsa.mp4" } } }, b4u_bridtv_on_ready); }); // ----- function b4u_bridtv_on_ad_end() { console.log("[BRIDTV] ad end"); setTimeout(function() { $bp(b4u_bridtv_conf.div_id).SlideInView.close.trigger("close"); $bp(b4u_bridtv_conf.div_id).pause(); }, b4u_bridtv_conf.end_sticky_timeout); } function b4u_bridtv_on_error() { console.log("[BRIDTV] ad error"); $bp(b4u_bridtv_conf.div_id).destroy(); //$bp(b4u_bridtv_conf.div_id).SlideInView.close.trigger("close"); // $bp(b4u_bridtv_conf.div_id).SlideInView.close.trigger("close"); }, b4u_bridtv_conf.end_sticky_timeout); } function b4u_bridtv_on_ready() { console.log("[BRIDTV] player ready"); $bp(b4u_bridtv_conf.div_id).add('adEnd', b4u_bridtv_on_ad_end); $bp(b4u_bridtv_conf.div_id).add('adError', b4u_bridtv_on_error); } } } function loadAdUnits() { //insertBanner(); var slots = []; var divAdv = jQuery(".gptslot").filter(function () { return (jQuery(this).data('addesktop') == undefined && jQuery(this).data('admobile') == undefined) || jQuery(this).data('addesktop') == "1"; }); if (Optiload.isMobile()) { divAdv = jQuery(".gptslot").filter(function () { return (jQuery(this).data('addesktop') == undefined && jQuery(this).data('admobile') == undefined) || jQuery(this).data('admobile') == "1"; }); } //mod campagna febbraio 2018 var intextIdSlot = 7; $gptslots = jQuery(divAdv).filter(function () { //if (Optiload.isMobile()) { // return (jQuery(this).data("adunitid") != intextIdSlot); //} else { return (jQuery(this).data("adunitid") != intextIdSlot && jQuery(this).data("adunitid") != 0 ); //} }); $gptneltesto = jQuery(divAdv).filter(function () { return jQuery(this).data("adunitid") == intextIdSlot; }); /* jQuery.each($gptslots, function () { slots.push({slot:$(this),targeting:[ {key:"ad_group",value:Adomik.randomAdGroup()}, {key:"ad_h",value:(new Date).getUTCHours().toString()} ]}); }); */ Optiload.sm.addSlots($gptslots); var gptneltestocounter = 1; jQuery.each($gptneltesto, function () { slots.push({slot:$(this),targeting:[ //{key:"ad_group",value:Adomik.randomAdGroup()}, //{key:"ad_h",value:(new Date).getUTCHours().toString()}, { key: "gptneltesto", value: gptneltestocounter.toString() } ]}); gptneltestocounter++; }); Optiload.sm.addSlotsWithTargeting(slots); } // function insertBanner() { // var $texte = jQuery(".entry-content").last(); // if ($texte.length > 0) { // var $p = $texte.find("p"); // var limit = $texte.data("banner") || 150; // var currentLimit = limit; // var wordCount = 0; // var count = Date.now() + 1; // var $pAndImg = $texte.find("p, img"); // for (var i = 0; i < $pAndImg.length; i++) { // var $node =jQuery( $pAndImg[i]); // if ($node.is("p")) { // wordCount += $node.text().split(' ').length; // if (wordCount > currentLimit) { // var j = i + 1; // var found = false; // while (j < $pAndImg.length && !found) { // if (jQuery($pAndImg[j]).is("p:not(.toc)") && jQuery($pAndImg[j]).text().trim().length > 0 ) { // found = true; // jQuery($pAndImg[j]).before( // "
" // ); // } // j++; // } // count++; // wordCount = 0; // } // } // } // } // } function loadSkin(idSkin) { $(document).ready(function () { var skin = null; $("body").append('
'); googletag.cmd.push(function () { skin = googletag.defineSlot(Optiload.adUnits[idSkin].name, Optiload.adUnits[idSkin].sizes, 'optiload-skin') //.setTargeting('ad_group', Adomik.randomAdGroup()) //.setTargeting('ad_h', (new Date).getUTCHours().toString()) .addService(googletag.pubads()); googletag.display('optiload-skin'); googletag.pubads().refresh([skin]); }); $("body").on("refreshskin", function () { googletag.cmd.push(function () { $("#GenecyDFPAdWallpaperCont").remove(); googletag.pubads().refresh([skin]); //console.log("skin refresh"); }); }); }); } function loadFloorad(idFloorad) { var css = "\ #floor-ad-wrapper {\ background: #fff!important;\ position: fixed;\ z-index: 99999;\ width: 100%;\ text-align: center;\ bottom: -294px;\ }\ .cont-floor {\ background: transparent;\ margin: 0 auto;\ position: relative;\ }\ #close {\ margin:0!important; font-size:13px!important;line-height:1.3;\ right: 0px;\ top: -22px;\ padding: 0.1rem 0.5rem;\ position: absolute;\ background: #ccc;\ cursor: pointer;\ z-index: 100000;\ color: #00aecd;\ font-weight: bold;\ }\ #close .close-btn{\ background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPlJREFUeNp8UjESgjAQDBkfYGkZf0BjDZZ28gN4kU+AH0hnCdQ2/ABKS36gu8zGOZ3Rm9khye7eXS4kzsTudt/iUwIZwPUCDEDzOB2WqPPGcMZnAi46GmTkfhK/RmIMV6AFKptV1WuAmgJcm+iQFXocFO5HQMekObD3ykBjJfIJ1FrX3MtXSXf2unRvWiJZQjxpKGsy8T31NAVgjm2AbEQGJWtMl9QFHxem91q9U5zHVhVrAa/RkozGUhOsYqtKFpRsiNn5Dp37E+R1T7cxl+9kZJXZiIPeiVWO78cVmeqBKRr1C3HEqe7Nhx0/TMZcypip//lrgu4lwADSY2+nhzpILAAAAABJRU5ErkJggg==');\ background-size:cover;\ width:13px;\ height:13px;\ margin-top:2px;\ margin-right:2px;\ display:inline-block;\ }\ #floor-ad {\ z-index: 10000;\ }\ @media(max-width:767px) {\ #close {\ left: 0;\ }\ }", head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); googletag.cmd.push(function () { googletag.pubads().addEventListener('slotRenderEnded', function (event) { if (event.slot.getSlotElementId() === "floor-ad" && !event.isEmpty) { console.info("[GPT] slotRenderEnded - " + 'floor-ad'); var adWidth = event.size[0]; var adHeight = event.size[1]; //se smart compra 1x1 non facciamo comparire nulla //if (adWidth === 1 || adHeight === 4) { if (adWidth === 1 && adHeight === 1) { return; } if(adHeight !== 4){ var iframe = $("#floor-ad-wrapper").find("iframe").first(); if (iframe.width() != adWidth || iframe.height() != adHeight) { console.log("Aggiustamento size floorad"); console.log("size gpt: " + adWidth + "X" + adHeight); console.log("size effettiva: " + iframe.width() + "X" + iframe.height()); adWidth = iframe.width(); adHeight = iframe.height(); } setTimeout(function () { $("#floor-ad-wrapper #close").show(); }, 500); setTimeout(function () { console.info("[GPT] triggered - " + 'floor-ad'); $("#floor-ad-wrapper").height(adHeight + 10); $("#floor-ad-wrapper>div").width(adWidth); $("#floor-ad-wrapper").animate({ bottom: 0 }); setTimeout(function () { console.info("[GPT] timeout triggered " + 'floor-ad'); $("#floor-ad-wrapper").animate({ bottom: -adHeight - 10 }, function () { $("#floor-ad-wrapper").remove(); }); }, 60000) }, 2000); } } }); }); function showFloorAd() { var floorad = "\
\
\

Chiudi

\
\
\
\
"; $floorad = $(floorad); $floorad.find("#close").on("click", function () { $floorad.remove(); }); $("body").append($floorad); Optiload.sm.createSlot(idFloorad, "floor-ad"); } function throttle(fn, wait) { var time = Date.now(); return function () { if ((time + wait - Date.now()) < 0) { fn(); time = Date.now(); } } } $(window).on("scroll", throttle(callback, 1000)); var triggered = false; function callback() { //console.log("callback"); if (!triggered && $(window).scrollTop() > 400) { triggered = true; showFloorAd(); } } } function loadSpotx() { include_js('//assets.evolutionadv.it/stickify-plugin.js?v=201802191336', function () { window["myAdDoneFunction"] = function (spotx_ad_found) { $("#container-spotx").slideUp(); }; var spotwidth = 400; var spotheight = 259; var s = ''; if (Optiload.isMobile()) { spotwidth = 320; spotheight = 208; s = ''; } var spotx = '
\
\
' + s + '
'; setTimeout(function () { var $texte = $(".texte").last(); if ($texte.length > 0) { var $p = $texte.find("p"); var $lastVisible = null; for (var i = 0; i < $p.length; i++) { if ($($p[i]).is(":in-viewport")) { $lastVisible = $($p[i]); } } if ($lastVisible) { $spotx = $(spotx); $lastVisible.after($spotx); console.log("SPOTX rendered"); $spotx.on("stuck", function () { if ($("#floor-ad-wrapper").length > 0) { $("#floor-ad-wrapper").remove(); } }); } setTimeout(function findVideo() { var $spotx = $("[data-spotx_content_container_generated=true]"); if ($spotx.length > 0 && $spotx.height() == spotheight) { $("#container-spotx").css("clear", "both"); $spotx.stickify({ wrapper: "#container-spotx" }); } else { setTimeout(findVideo, 1000); } }, 2000); } }, 7000); }); } Optiload.bus.on("optiload_ready", function () { function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } if(!getParameterByName('vastcreative')) { if($(window).width() < 768){ return false; } var playlist = [ { titre: "3 colpi passante in corsa", urlvideo: "https://www.tennisworlditalia.com/video/3_colpi_passante_in_corsa.mp4", logo:'https://www.tennisworlditalia.com/video/3_colpi_passante_in_corsa.jpg' }, { titre: "Una volee, uno smash", urlvideo: "https://www.tennisworlditalia.com/video/Una_volee,_uno_smash.mp4", logo:'https://www.tennisworlditalia.com/video/Una_volee,_uno_smash.jpg' }, { titre: "Ventaglio", urlvideo: "https://www.tennisworlditalia.com/video/ventaglio.mp4", logo:'https://www.tennisworlditalia.com/video/ventaglio.jpg' } ]; playlist.sort(function(a, b){return 0.5 - Math.random()}); var playlistDefault = playlist; var $wrap = $( "
\
\
\
" ); var $mh = $wrap.find("#optiload-masthead"); var $header = $("header"); $("div[data-adunitid='0']").after($wrap); var receiver = null; Optiload.sm.createSlot(0, "optiload-masthead", [{ key: "campagna", value: "test" }]); var _scrollOffset = -1; var _slotHeight = 270; googletag.cmd.push(function () { googletag.pubads().addEventListener('slotRenderEnded', function (event) { if (event.isEmpty) { return; } if (event.slot.getSlotElementId() === 'optiload-masthead-pb') { _slotHeight = event.size[1] +20; setLayout(); setTimeout(function(){ onViewability(); },5000); } }); }); googletag.cmd.push(function () { googletag.pubads().addEventListener('slotRenderEnded', function (event) { if (event.isEmpty) { return; } if (event.slot.getSlotElementId() === 'optiload-masthead') { var messageReceived = false; _slotHeight = event.size[1] + 20; window.addEventListener("message", function (msgEvent) { if(msgEvent.origin != "https://assets.evolutionadv.it"){return ;} if(msgEvent.data == "optiload:initialized"){ console.log("OPTILOAD: content window ready"); messageReceived = true; //setLayout(); } else if (msgEvent.data.indexOf("optiload:slotsize|") == 0) { _slotHeight = parseInt(msgEvent.data.substring("optiload:slotsize|".length)) + 20; setLayout(); }else if (msgEvent.data == "optiload:viewability") { onViewability(); }else if (msgEvent.data == "optiload:adserror") { $mh.empty().removeAttr("data-google-query-id"); $mh.append("
"); Optiload.sm.createSlot(0, "optiload-masthead-pb"); } },false); receiver = null; var iframecontents = $wrap.find("iframe").contents(); var vmh = $wrap.find("iframe").contents().find("#vast-masthead")[0]; if (vmh) { receiver = vmh.contentWindow; setTimeout(function setReceiver() { receiver.postMessage('optiload:init|' + JSON.stringify(playlist), "https://assets.evolutionadv.it"); setTimeout(function () { if (!messageReceived) { setReceiver(); } }, 1000); }, 1000); }else{ setLayout(); setTimeout(function(){ onViewability(); },5000); } } }); }); googletag.cmd.push(function () { googletag.pubads().addEventListener('slotRenderEnded', function (event) { if (event.slot.getSlotElementId() === "optiload-skin" && !event.isEmpty) { setTimeout(function testScroll() { if($("body").hasClass("evo-adv-skin")){ $(window).trigger("scroll"); }else{ setTimeout(testScroll,1000); } }, 1000); } }); }); function setLayout() { $wrap.css({ height: _slotHeight, top: "", width: "100%", //"z-index":10000, background: "#ffffff", position:"static" }); $(window).on("scroll",setLayoutOnScroll); $(window).trigger("scroll"); $wrap.find("iframe").height(_slotHeight - 20); $("body").addClass("optiload-masthead-visible"); } function setLayoutOnScroll(){ // if( !$("body").hasClass("evo-adv-skin")) { return;} if($wrap.offset().top - $(window).scrollTop() <= 0 && $wrap.offset().top >= 0){ $mh.css({ position: "fixed", top: 0, "z-index": 11000, // width: "100%", left: 0, right: 0, background: "#ffffff" }); }else{ $mh.css({ position: "static", background: "#ffffff" }); } } function onViewability() { $(window).off("scroll",setLayoutOnScroll); $wrap.css({ height: _slotHeight}); $mh.css({ "z-index": 9000}); if ($(window).scrollTop() > 0) { // $header.fadeOut("slow", function () { // $header.show(); // }); $mh.fadeOut("slow", function () { $mh.show(); //setScroll(height); _scrollOffset = 0; $(window).trigger("scroll"); $("body").removeClass("optiload-masthead-visible"); $("body").addClass("optiload-masthead-end-viewability"); }); } else { // setScroll(height); _scrollOffset = 0; $(window).trigger("scroll"); $("body").removeClass("optiload-masthead-visible"); $("body").addClass("optiload-masthead-end-viewability"); } } $(window).on("scroll", function () { if (_scrollOffset != -1) { if (receiver) { if ($(window).scrollTop() > _scrollOffset) { receiver.postMessage('optiload:pause', "https://assets.evolutionadv.it"); } else { receiver.postMessage('optiload:play', "https://assets.evolutionadv.it"); } } $("body").toggleClass("scroll0", $(window).scrollTop() == 0); $wrap.css({ top: -$(window).scrollTop() }); $mh.css({ position: "relative" }); } }); } }); }(jQuery, Optiload));