Refresh DFP ads

2019-09-14 17:34发布

I have a static chat page with Google DFP ads around it.

Is there a way to get those ads automaticly refresh every 5 minutes or so? I just want to refresh the ads, not the whole page.

I know that Google offers some tags like googletag.pubads().refresh(); but im not sure if i can use them for this purpose.

Thank you

3条回答
We Are One
2楼-- · 2019-09-14 17:55

Yeah just set an interval of 300000 and use the refresh method like you mentioned. Technically I think it may be against the terms of service to refresh the ads on a timer without user interaction... but I'm not 100% on that and you would need to research the terms a bit more on the DFP site.

查看更多
趁早两清
4楼-- · 2019-09-14 18:02

This code should help:

<html>
<head>
  ...
</head>
<body>
  ...
      <!-- PUT THESE LINES ON THE FOOT OF YOUR PAGE -->
<script type="text/javascript">
   setInterval(function(){googletag.pubads().refresh();}, 300000);});  
</script>

查看更多
登录 后发表回答