简体   繁体   English

Google DFP广告管理系统-刷新广告位,不增加新的展示次数

[英]Google DFP - Refresh AD slot without New Impression Count

I need to refresh all ad slots after 15 sec and load new ads to the slots without counting new impression. 我需要在15秒后刷新所有广告位,然后将新广告加载到该广告位中而不计入新的展示次数。 ** This works : **这有效:

googletag.pubads().refresh([slot1], {changeCorrelator: false});

**but when I add the set interval 30 sec.. it is not refreshing- **但是当我添加30秒的设置间隔时。

setInterval(function(){googletag.pubads().refresh(null, {changeCorrelator: false}, 30000)});

Pls help..Tnx 请帮助..Tnx

The syntax is: 语法为:

setInterval(function, milliseconds) 

The code bellow should work: 下面的代码应该工作:

setInterval(function(){
    googletag.pubads().refresh(null, {changeCorrelator: false});
}, 30000);

The problem you have is due to the fact that the refresh() call should be pushed to googletag commands. 您遇到的问题是由于应将refresh()调用googletag命令的事实。 So this should solve your issue: 因此,这应该可以解决您的问题:

setInterval(function(){
    googletag.cmd.push(function() {
         // refresh fetches a new ad for each slot, without changing the correlator.
        googletag.pubads().refresh(null, {changeCorrelator: false});
    });
}, 30000);

Please note this line in th example above: googletag.cmd.push(function() {...}); 请注意上面示例中的这一行: googletag.cmd.push(function(){...});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM