簡體   English   中英

Google DFP廣告管理系統-刷新廣告位,不增加新的展示次數

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

我需要在15秒后刷新所有廣告位,然后將新廣告加載到該廣告位中而不計入新的展示次數。 **這有效:

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

**但是當我添加30秒的設置間隔時。

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

請幫助..Tnx

語法為:

setInterval(function, milliseconds) 

下面的代碼應該工作:

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

您遇到的問題是由於應將refresh()調用googletag命令的事實。 因此,這應該可以解決您的問題:

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);

請注意上面示例中的這一行: googletag.cmd.push(function(){...});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM