最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to implement an HTML5 DoubleClick ClickTag? - Stack Overflow

programmeradmin2浏览0评论

I have created an html5 banners and validated it here: .

It returns the error: "Missing click tag check".

How do I implement a clickTag? I've found this code on google support:

<html>
  <head>
    <meta name="ad.size" content="width=300,height=250">
    <script type="text/javascript">
      var clickTag = ""; 
    </script>
  </head>

  <body>
    <a href="javascript:window.open(window.clickTag)">
      <img src="images/dclk.png" border=0>
    </a>
  </body>
</html>

But isn't the destination URL of the banner set after uploading the ZIP file in DoubleClick?

Do I have to set the destination URL hardcoded in the HTML? Doesn't make any sense to me..

I have made a lot of flash banners in the past and there you only referred to a variable _root.clickTag.

Can anyone help me out?

Thanks

I have created an html5 banners and validated it here: https://h5validator.appspot./dcm.

It returns the error: "Missing click tag check".

How do I implement a clickTag? I've found this code on google support:

<html>
  <head>
    <meta name="ad.size" content="width=300,height=250">
    <script type="text/javascript">
      var clickTag = "http://www.google."; 
    </script>
  </head>

  <body>
    <a href="javascript:window.open(window.clickTag)">
      <img src="images/dclk.png" border=0>
    </a>
  </body>
</html>

But isn't the destination URL of the banner set after uploading the ZIP file in DoubleClick?

Do I have to set the destination URL hardcoded in the HTML? Doesn't make any sense to me..

I have made a lot of flash banners in the past and there you only referred to a variable _root.clickTag.

Can anyone help me out?

Thanks

Share Improve this question asked Feb 22, 2016 at 11:25 albert105albert105 1191 gold badge2 silver badges8 bronze badges 1
  • Same question here. It makes little sense to me that the documentation calls for a clickTag to be hardcoded in the individual creative, when the clickthrough URL gets assigned in DoubleClick. Any insight? I don't understand why there would ever be a clickTag = "url" declaration. – Bangkokian Commented Nov 14, 2016 at 9:30
Add a ment  | 

1 Answer 1

Reset to default 1

In order to create a doubleclick studio banner you need to import doubleclick studio library and initialize enabler. Then set Exit_url. Save yourself all the trouble create the Banner in Google Web Designer its easy and will upload directly to DC studio

    <script src="https://s0.2mdn/ads/studio/Enabler.js"></script>

       <style>html, body {width: 100%; height: 100%}
        #bg-exit {
        background-color: rgba(255,255,255,0);
        cursor: pointer;
        height: 381px; //banner height
        left: 0px;
        position: absolute;
        top: 19px;
        width: 400px; //banner width
        z-index: 1;
    }</style>

   <div id="bg-exit"></div> <!-- put this div inside your main container of banner -->

<script>
    window.onload = function() {
  if (Enabler.isInitialized()) {
    enablerInitHandler();
  } else {
    Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler);
  }
}

function enablerInitHandler() {

}
    function bgExitHandler(e) {
  Enabler.exit('Background Exit');
}

document.getElementById('bg-exit').addEventListener('click', bgExitHandler, false);
    </script>

Using this code you can change the exit_url from DC studio Dynamically

发布评论

评论列表(0)

  1. 暂无评论