加速移动页面(Amp):用于双击的放大器广告

时间:2016-02-02 16:47:20

标签: amp-html

我试图绕过amps ad-compononent的组合来进行双击。 要使用id需要定义属性data-slot,就像在这个(唯一可用的)示例中一样:

 <amp-ad width=320 height=50
 type="doubleclick"
 data-slot="/4119129/mobile_ad_banner">
</amp-ad>]]>

我的问题是,如果有人知道,如何生成数据槽和/或其中包含哪些组件,因为我没有得到它?

非常感谢你的帮助!

其他链接:https://github.com/ampproject/amphtml/blob/master/ads/doubleclick.md https://github.com/ampproject/amphtml/blob/master/ads/doubleclick.js

2 个答案:

答案 0 :(得分:1)

解决了它:

<amp-ad width=300 height=250
type="doubleclick"
data-slot="/advertUrl/advertZone">
json='{"targeting":{insert targeting here}
</amp-ad>

答案 1 :(得分:0)

JS生成DFP代码的

Here is the example,您可以轻松查找/ google如何生成它。 看看这一行:

googletag.defineSlot("/1234/travel/asia/food", [728, 90], "div-gpt-ad-123456789-0")

data-slot 是来自js代码的第一个 defineSlot 参数, 所以AMP代码必须是这样的:

<amp-ad width=320 height=50
 type="doubleclick"
 data-slot="/1234/travel/asia/food">
</amp-ad>
相关问题