var googletag = googletag || {}
gptAdSlot = gptAdSlotFooter = [],
_numParagrafi = $ (& # 39 ;. article-content__body p: not (.suggerimenti) & # 39;). length;
googletag.cmd = googletag.cmd || [];
if (! $ ('body'). hasClbad ('previewClbad')) {
googletag.cmd.push (function () {
var mapping = googletag.sizeMapping (). addSize ([1024, 0][728, 90]) .addSize ([980, 0][728, 90]) .addSize ([768, 0][728, 90]) .addSize ([0, 0][320, 50] ]) build ().
gptAdSlotFooter = googletag.defineSlot (# 38214307 / 728x90_intra_Article), [728, 90] -div-gpt-ad-1509613789687-0 & # 39;)
.defineSizeMapping (mapping)
.addService (googletag.pubads ())
.setCollapseEmptyDiv (true, true);
googletag.pubads () enableSingleRequest ().
googletag.enableServices ();
if ($ ('body'). hasClbad ('article-page') &&! $ ('body'). hasClbad (& # 39; newsletter & # 39; ;)) {
gptAdSlotArticle = googletag.defineSlot (& # 39; / 38214307 / intra_article & # 39 ;, [300, 250] & # 39; div-gpt-ad-1507624052181-0 & # 39;)
.addService (googletag.pubads ())
.setCollapseEmptyDiv (true, true);
googletag.pubads () enableSingleRequest ().
googletag.enableServices ();
}
});
if (! $ ('body'). hasClbad ('newsletter')) {
$ (& # 39;
+
& # 39; <' + 'script type="text-javascript"> & # 39; +
setTimeout (function () {
googletag.cmd.push (function () {
googletag.display (-div-gpt-ad-1509613789687-0 & # 39;)
});
// refreshSlot (gptAdSlotFooter);
}, 300) +
& # 39; ' + 'script>
& # 39;). PrependTo (". Container-fluid> footer");
var refreshSlot = function (location) {
googletag.cmd.push (function () {
googletag.pubads () refresh ([slot]).
});
};
}
if ($ ('body'). hasClbad ('article-page') &&! $ ('body'). hasClbad (& # 39; newsletter & # 39; ;)) {
if (_numParagrafi> 2) {
$ (& # 39;
+
setTimeout (function () {
googletag.cmd.push (function () {
googletag.display ("div-gpt-ad-1507624052181-0");
});
// refreshSlot (gptAdSlotFooter);
}, 300) +
"' + 'script>
"). AppendTo ("Article-content__body p: nth-child (3)");
} else {
$ (& # 39;
+
& # 39; <' + 'script type="text-javascript"> & # 39; +
setTimeout (function () {
googletag.cmd.push (function () {
googletag.display ("div-gpt-ad-1507624052181-0");
});
// refreshSlot (gptAdSlotFooter);
}, 300) +
& # 39; ' + 'script>
& # 39;). AppendTo (". Article-content__body p: first");
}
;
}
}
if (! $ ('body'). hasClbad ('previewClbad')) {
window.fbAsyncInit = function () {
FB.init ({
appId: & # 39; 2248950268464338 & # 39;
cookies: true,
xfbml: true,
version: & # 39; v2.11 & # 39;
});
FB.AppEvents.logPageView ();
if (typeof cognitoObj! = & # 39; undefined & # 39;) {
FB.getLoginStatus (cognitoObj.facebookStatusChangeCallback);
}
};
(function (d, s, id) {
var js, fjs = d.getElementsByTagName (s) [0];
if (d.getElementById (id)) {
return;
}
js = d.createElement (s);
js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore (js, fjs);
} (document, 'script', 'facebook-jssdk'));
}
[ad_2]
Source link