Ad code implementation
Set up Auto ads on your AMP site
Auto ads for AMP automatically place AdSense Auto ads on your AMP pages. After you've added the AMP auto script and ad code, Google will automatically show ads on your AMP pages at optimal times when they're likely to perform well and provide a good experience.
Before you get started
- Prepare your pages for discovery with
<link>tags to pair non-AMP and AMP content.
<link>tags in the
<head>of each AMP and non-AMP page to indicate which content belongs together.
In the non-AMP example.com/news page:
<link rel="amphtml" href="http://example.com/amp/news">
In the AMP example.com/amp/news page:
<link rel="canonical" href="http://example.com/news">
Set up Auto ads for AMP
- Sign in to your AdSense account.
- Click Ads Overview.
- Click Got an AMP site?
- On the "Get AdSense code for AMP site" page, turn on Let Google place display ads on your AMP sites.
- Copy and paste the
amp-auto-adsscript between the
<head></head>tags of your page.
This script loads the required
amp-auto-adslibraries. Learn more about the
- Copy and paste the AMP Auto ad code immediately after the opening
<body>tag of the pages you want ads to appear.
- Click Done. It can take up to an hour for ads to appear on the page.
On your Ads page, it now says "AMP is on".
Tracking the performance of Auto ads for AMP
You can track the performance of your Auto ads for AMP by viewing the Content platform report on your Reports page.