我创建了一个 html5 横幅并在此处对其进行了验证: https://h5validator.appspot.com/dcm .
它返回错误:“缺少点击代码检查”。
如何实现 clickTag?我在谷歌支持上找到了这段代码:
<html>
<head>
<meta name="ad.size" content="width=300,height=250">
<script type="text/javascript">
var clickTag = "http://www.google.com";
</script>
</head>
<body>
<a href="javascript:window.open(window.clickTag)">
<img src="images/dclk.png" border=0>
</a>
</body>
</html>
但在 DoubleClick 中上传 ZIP 文件后,横幅的目标 URL 不是设置了吗?
我是否必须设置在 HTML 中硬编码的目标 URL?对我来说没有任何意义..
我过去制作了很多 flash 横幅,而你只提到了一个变量 _root.clickTag。
谁能帮帮我?
谢谢
最佳答案
为了创建 doubleclick studio 横幅,您需要导入 doubleclick studio 库并初始化启用程序。然后设置 Exit_url。省去所有麻烦,在 Google Web Designer 中创建横幅非常简单,并且会直接上传到 DC studio
<script src="https://s0.2mdn.net/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>
使用此代码,您可以从 DC studio 动态更改 exit_url
关于javascript - 如何实现 HTML5 DoubleClick ClickTag?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35552392/