0

I realize there's not quite any "standards" in place for creating HTML5 ads. But is there a best practice for entering a clickTag on Ads that makes use of <noscript>?

I assume this implementation largely depends on the ad-server it's uploaded to, but how could the clickTag dynamically change if Javascript is disabled?

Could it change on the server-side (ex: replaced upon request via PHP) even though the page has an *.html extension instead of *.php?

So far I have this for the HTML of an Ad:

<body>
    <!--Won't Work for noscript!-->
    <a href="javascript:window.open(window.clickTag+_local1);">
      <div id="content">
        <noscript>
          <img src="backup.jpg" alt="backup image">
        </noscript>
      </div>
    </a>

    <script type="text/javascript">
        var _local1 = '80205';
        var clickTag = "http://www.google.com/";
    </script>
</body>
4

1 回答 1

1

支持的广告服务器<noscript>应在投放广告之前更改服务器端的值(请参阅其规范)。如果没有,我相信唯一的选择是对链接进行硬编码。

<a href="http://www.google.com/80205" onclick="window.open(window.clickTag+_local1); return false;">
    <div id="content">
        <noscript>
            <img src="backup.jpg" alt="backup image">
        </noscript>
    </div>
</a>

如果你像上面那样做,如果 javascript 可用,将使用 clickTag,否则用户将被发送到硬编码的 url。

于 2015-09-17T19:15:58.413 回答