Refresh DFP ads

你离开我真会死。 提交于 2019-12-12 02:59:43

问题


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


回答1:


Check here it is feirly simple: https://support.google.com/dfp_premium/answer/2694377?hl=en&ref_topic=28788




回答2:


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.




回答3:


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>



来源:https://stackoverflow.com/questions/15279851/refresh-dfp-ads

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!