window.avCustomConfig = window.avCustomConfig || {}; window.googletag = window.googletag || {cmd: []}; googletag.cmd.push(function() { googletag.pubads().setTargeting('id_post_wp', ['']); var urlParams = new URLSearchParams(window.location.search); var utmParams = ['src', 'utm_medium', 'utm_content', 'utm_campaign']; utmParams.forEach(function(param) { var value = urlParams.get(param) ?? sessionStorage.getItem(param); if (value) { console.log(param + ':', value); // In các giá trị tham số UTM ra bảng điều khiển sessionStorage.setItem(param, value); // Lưu trữ trong sessionStorage googletag.pubads().setTargeting(param, [value]); } }); googletag.enableServices(); googletag.cmd.push(function() { var interstitialSlot = googletag.defineOutOfPageSlot('/22013536576/dicasecia.com/dicasecia.com_interstitial', googletag.enums.OutOfPageFormat.INTERSTITIAL); nếu (interstitialSlot) { interstitialSlot.addService(googletag.pubads()); googletag.enableServices(); googletag.display(interstitialSlot.getSlotElementId() } }); /* googletag.cmd.push(function() { var anchorSlot = googletag.defineOutOfPageSlot('/22013536576/dicasecia.com/dicasecia.com_top_anchor', googletag.enums.OutOfPageFormat.TOP_ANCHOR); nếu (anchorSlot) { anchorSlot.addService(googletag.pubads()); googletag.enableServices(); googletag.display(anchorSlot.getSlotElementId()); */ let search = new URLSearchParams(window.location.search); let avSrc = search.get('teste') ?? sessionStorage.getItem('avSrc') ?? ''; sessionStorage.setItem('avSrc', avSrc); window.avCustomConfig['extraKVs'] = { 'id_post_wp': '', 'test': sessionStorage.getItem('avSrc'), 'src': sessionStorage.getItem('src'), 'utm_medium': sessionStorage.getItem('utm_medium'), 'utm_content': sessionStorage.getItem('utm_content'), 'utm_campaign': sessionStorage.getItem('utm_campaign') };

bài viết mới nhất

Phổ biến