For instructions on AMP header bidding, see
Add required javascript
Add the following script tag in the HEAD section of your AMP page.
<script type='text/javascript' src='https://cdn.ampproject.org/v0/amp-ad-0.1.js' async custom-element="amp-ad"></script>
Add tags to your HTML
Add the following tag in your HTML in each location that you want an ad to appear. Substitute your GAM ad unit name for the value of the data-slot
attribute.
<amp-ad
type="doubleclick"
width="300"
height="250"
data-slot="/12345/medrec"
></amp-ad>
Sticky Ads
AMP can also support sticky ads. This requires an additional script. Add the following script tag to the HEAD section of your AMP page
<script type='text/javascript' src='https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js' async custom-element="amp-sticky-ad"></script>
Then add the following HTML for the sticky ad
<amp-sticky-ad layout="nodisplay">
<amp-ad
type="doubleclick"
width="320"
height="50"
data-slot="/12345/leaderboard"
></amp-ad>
</amp-sticky-ad>
For more information about configuring sticky ads, see: