var CONTADV = CONTADV || {}; CONTADV.COmappingForce = {}; CONTADV.myContSegment = function() { var myWidth = window.innerWidth; console.log('wwww ' + myWidth); if (myWidth >= 980) { return 'desktop'; } else if (myWidth >= 768 && myWidth < 980) { return 'tablet'; } else { return 'mobile'; } } CONTADV.COtarget = {} CONTADV.COtarget.tags = { skin: {path:"/22057399995/EconomyMagazine_Skin_Desktop"}, native:{path:"/22057399995/EconomyMagazine_Native_Desktop"}, "300x250":{path:"/22057399995/EconomyMagazine_300x250_Desktop"}, "300x250_2":{path:"/22057399995/EconomyMagazine_300x250_Desktop_2"}, "300x250_3":{path:"/22057399995/EconomyMagazine_300x250_Desktop_3"}, "300x250_4":{path:"/22057399995/EconomyMagazine_300x250_Desktop_4"}, "300x250_5":{path:"/22057399995/EconomyMagazine_300x250_Desktop_5"}, "300x250_6":{path:"/22057399995/EconomyMagazine_300x250_Desktop_6"}, "300x250_7":{path:"/22057399995/EconomyMagazine_300x600_Desktop"}, "300x250_8":{path:"/22057399995/EconomyMagazine_300x600_Desktop_2"}, "300x250_9":{path:"/22057399995/EconomyMagazine_300x600_Desktop_3"}, "300x250_10":{path:"/22057399995/EconomyMagazine_300x600_Desktop_4"}, "300x250_11":{path:"/22057399995/EconomyMagazine_300x600_Desktop_5"}, "300x250_12":{path:"/22057399995/EconomyMagazine_300x600_Desktop_6"}, "980x250":{path:"/22057399995/EconomyMagazine_970x250_Desktop"}, "1080x100":{path:"/22057399995/EconomyMagazine_1080x100_Desktop"}, "100x200":{path:"/22057399995/EconomyMagazine_100x200_Desktop"}, "200x100":{path:"/22057399995/EconomyMagazine_200x100_Desktop_DX"}, "728x90":{path:"/22057399995/EconomyMagazine_728x90_Desktop"}, "320x50":{path:"/22057399995/EconomyMagazine_320x50_Mobile"}, "leaderboard":{path:"/22057399995/EconomyMagazine_leaderboard"}, } CONTADV.COtarget.pos = { skin: {id:"con-gpt-skin"}, native:{id:"con-gpt-native"}, "300x250":{id:"con-gpt-300x250"}, "300x250_2":{id:"con-gpt-300x250_2"}, "300x250_3":{id:"con-gpt-300x250_3"}, "300x250_4":{id:"con-gpt-300x250_4"}, "300x250_5":{id:"con-gpt-300x250_5"}, "300x250_6":{id:"con-gpt-300x250_6"}, "300x250_7":{id:"con-gpt-300x250_7"}, "300x250_8":{id:"con-gpt-300x250_8"}, "300x250_9":{id:"con-gpt-300x250_9"}, "300x250_10":{id:"con-gpt-300x250_10"}, "300x250_11":{id:"con-gpt-300x250_11"}, "300x250_12":{id:"con-gpt-300x250_12"}, "980x250":{id:"con-gpt-980x250"}, "1080x100":{id:"con-gpt-1080x100"}, "100x200":{id:"con-gpt-manchette_sx"}, "200x100":{id:"con-gpt-manchette_dx"}, "728x90":{id:"con-gpt-728x90"}, "320x50":{id:"con-gpt-320x50"}, "leaderboard":{id:"con-gpt-leaderboard"}, } CONTADV.COmappingForce = { "300x250_3":{size:"300x250_2"}, "300x250_4":{size:"300x250_2"}, "300x250_5":{size:"300x250_2"}, "300x250_6":{size:"300x250_2"}, "300x250_7":{size:"300x250_2"}, "300x250_8":{size:"300x250_2"}, "300x250_9":{size:"300x250_2"}, "300x250_10":{size:"300x250_2"}, "300x250_11":{size:"300x250_2"}, "300x250_12":{size:"300x250_2"}, "leaderboard":{size:"980x250"}, }; if(window.location.href == 'https://www.economymagazine.it/'){ CONTADV.COmappingForce = { "728x90":{size:"980x250"} } CONTADV.COtarget.tags = { skin: {path:"/22057399995/EconomyMagazine_Skin_Desktop"}, native:{path:"/22057399995/EconomyMagazine_Native_Desktop"}, "300x250":{path:"/22057399995/EconomyMagazine_300x250_Desktop"}, "300x250_2":{path:"/22057399995/EconomyMagazine_300x250_Desktop_2"}, "300x250_3":{path:"/22057399995/EconomyMagazine_300x250_Desktop_3"}, "300x250_4":{path:"/22057399995/EconomyMagazine_300x250_Desktop_4"}, "300x250_5":{path:"/22057399995/EconomyMagazine_300x250_Desktop_5"}, "300x250_6":{path:"/22057399995/EconomyMagazine_300x250_Desktop_6"}, "300x250_7":{path:"/22057399995/EconomyMagazine_300x600_Desktop"}, "300x250_8":{path:"/22057399995/EconomyMagazine_300x600_Desktop_2"}, "300x250_9":{path:"/22057399995/EconomyMagazine_300x600_Desktop_3"}, "300x250_10":{path:"/22057399995/EconomyMagazine_300x600_Desktop_4"}, "300x250_11":{path:"/22057399995/EconomyMagazine_300x600_Desktop_5"}, "300x250_12":{path:"/22057399995/EconomyMagazine_300x600_Desktop_6"}, "980x250":{path:"/22057399995/EconomyMagazine_970x250_Desktop"}, "1080x100":{path:"/22057399995/EconomyMagazine_1080x100_Desktop"}, "100x200":{path:"/22057399995/EconomyMagazine_100x200_Desktop"}, "200x100":{path:"/22057399995/EconomyMagazine_200x100_Desktop_DX"}, "320x50":{path:"/22057399995/EconomyMagazine_320x50_Mobile"}, "728x90":{path:"/22057399995/EconomyMagazine_970x250_Desktop"}, "leaderboard":{path:"/22057399995/EconomyMagazine_leaderboard"}, } } CONTADV.COmapping = { skin: [ [ [980, 200], [ [2, 1], [1, 1] ] ], [ [768, 300], [ [2, 1], [1, 1] ] ], [ [320, 480], [ [2, 1], [1, 1], ] ], [ [0, 0], [ [2, 1], [1, 1] ] ] ], "980x250": [ [ [995, 200], [ [1, 1], [970, 250], [970, 90], [980, 250], [980, 350], [728, 90] ] ], [ [980, 200], [ [1, 1], [970, 250], [970, 90], [980, 250], [980, 350] ] ], [ [768, 300], [ [728, 90], [1, 1] ] ], [ [320, 300], [] ], [ [0, 0], [] ] ], "300x250": [ [ [980, 200], [ [1, 1], [300, 250], "fluid", [300, 100], [300, 600], ] ], [ [768, 300], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ], [ [320, 300], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ], [ [0, 0], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ] ], "300x100": [ [ [980, 200], [ [1, 1], [300, 100] ] ], [ [768, 300], [ [1, 1], [300, 100] ] ], [ [320, 480], [ [1, 1], [300, 100] ] ], [ [0, 0], [ [1, 1], [300, 100] ] ] ], "300x250_2": [ [ [980, 200], [ [1, 1], [300, 250], "fluid", [300, 100], [300, 600], ] ], [ [768, 300], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ], [ [320, 300], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ], [ [0, 0], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ] ], "300x250_mobile": [ [ [980, 200], [ ] ], [ [768, 300], [ ] ], [ [320, 300], [ [300, 250], [1, 1], "fluid", [300, 100] ] ], [ [0, 0], [ [300, 250], [1, 1], "fluid", [300, 100] ] ] ], "300x250_deskt": [ [ [980, 200], [ [1, 1], [300, 250], "fluid", [300, 100], [300, 600], ] ], [ [768, 300], [ [300, 250], [1, 1], "fluid", [300, 100], [300, 600] ] ], [ [320, 300], [ ] ], [ [0, 0], [ ] ] ], "728x90": [ [ [980, 200], [ [1, 1], [728, 90] ] ], [ [768, 300], [ [1, 1], [728, 90] ] ], [ [320, 300], [ [1, 1], [320, 100], [320, 50] ] ], [ [0, 0], [ [1, 1], [320, 100], [320, 50] ] ] ], "320x50": [ [ [980, 200], [] ], [ [768, 300], [] ], [ [320, 300], [ [1, 1], [320, 100], [320, 50] ] ], [ [0, 0], [ [1, 1], [320, 100], [320, 50] ] ] ], "320x50_2": [ [ [980, 200], [] ], [ [768, 300], [] ], [ [320, 300], [ [1, 1], [320, 100], [320, 50] ] ], [ [0, 0], [ [1, 1], [320, 100], [320, 50] ] ] ], "1080x100": [ [ [980, 200], [1080,100], [970, 250], [970, 90], [980, 250], [980, 350] ], [ [768, 300], [] ], [ [320, 300], [] ], [ [0, 0], [] ] ], "100x200":[ [ [980, 200], [ [200, 100], [100, 200] ] ], [ [768, 300], [ [200, 100], [100, 200] ] ], [ [320, 300], [] ], [ [0, 0], [] ] ], "200x100": [ [ [980, 200], [ [200, 100], [100, 200] ] ], [ [768, 300], [ [200, 100], [100, 200] ] ], [ [320, 300], [] ], [ [0, 0], [] ] ], native: [ [ [980, 200], [ [1, 1], [8,1] ] ], [ [768, 300], [ [1, 1], [8,1] ] ], [ [320, 300], [ [1, 1], [8,1] ] ], [ [0, 0], [ [1, 1], [8,1] ] ] ], } var urlParamsgpt = new URLSearchParams(window.location.search); var utmFilter = urlParamsgpt.get('utm_source'); var subdomaingpt = window.location.host.split('.')[1] ? window.location.host.split('.')[0] : false; console.log('subdomaingpt '+subdomaingpt); console.log('utmFilter '+utmFilter); console.log('urlParamsgpt '+urlParamsgpt); CONTADV.ad = []; function first() { var css = document.createElement('style'); css.type = 'text/css'; var styles =".stick {position: fixed; top: 0;width: 100%; z-index: 10;}"; s = document.createElement("script"); s.type = "text/javascript"; //s.async = "true"; s.src = " https://www.googletagservices.com/tag/js/gpt.js"; document.head.appendChild(s); window.googletag = window.googletag || {cmd: []}; googletag.cmd.push(function() { var t =CONTADV.COtarget.tags; if (t) { for (var o in CONTADV.COtarget.tags){ var e = CONTADV.COtarget.pos[o]['id']; CONTADV.ad[o] = googletag.defineSlot(t[o].path, [1,1], e).addService(googletag.pubads()); var map = o; if(o in CONTADV.COmappingForce){ map = CONTADV.COmappingForce[o]['size']; } var p = CONTADV.COmapping[map]; CONTADV.ad[o].defineSizeMapping(p); } if(utmFilter){ googletag.pubads().setTargeting('utmfilters', utmFilter); } if(subdomaingpt){ googletag.pubads().setTargeting('subdomain', subdomaingpt); } googletag.pubads().setCentering(true); googletag.pubads().collapseEmptyDivs(true); googletag.enableServices(); } for (var t in CONTADV.COtarget.pos) { document.querySelectorAll("#" + CONTADV.COtarget.pos[t].id).length && (googletag.display(CONTADV.COtarget.pos[t].id)); } var targetSlot = 'con-gpt-320x50'; googletag.pubads().addEventListener('slotRenderEnded', function(event) { var slot = event.slot; console.log(slot.getSlotElementId(),' rendered'); if(event.isEmpty && slot.getSlotElementId() == targetSlot) { console.log(event); //console.log('Creative iframe for slot', slot.getSlotElementId(),'has loaded.'); styles =".con-sticky{display:none;}"; } }); }); if (css.styleSheet) css.styleSheet.cssText = styles; else css.appendChild(document.createTextNode(styles)); document.head.appendChild(css); } first();