0
votes

im trying to get around the composition of amps ad-compononent for doubleclick. To be used id needs to have the attribute data-slot defined, like in this (the only available) example:

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

My Question is, if anybody knows, how to generate that data-slot and/or what components are in it, because i don´t get it?

Thank you very much for your help!

additional links: https://github.com/ampproject/amphtml/blob/master/ads/doubleclick.md https://github.com/ampproject/amphtml/blob/master/ads/doubleclick.js

2

2 Answers

1
votes

Solved it:

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

Here is the example of JS generated DFP code, you can easy find/google how to generate it. Look at this line:

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

data-slot is first defineSlot parameter from js code, so AMP code must be like this:

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