AMP (Accelerated Mobile Pages) is a method to build fast websites especially for mobile devices. Due to many technical restrictions, displaying ads is not as straight forward as on “normal” websites. On this page we cover the different ways to use and the limitations of ads on AMP pages:
- How to build an AMP page?
- AdSense on AMP pages
- AMP ad type for other ad networks
- Images and other ads on AMP pages
- General limitations
How to set up an AMP page?
The most popular solution to create AMP pages in WordPress is the AMP plugin by Automattic. It creates an AMP version of posts on a subdomain that ends with /amp/.
We built our solution for ads on AMP pages on this “official” plugin. If you are using another solution and run into issues then please let us know.
Our solution for ads on AMP pages works with the following plugins:
- AMP by Automattic
- WP AMP — Accelerated Mobile Pages for WordPress and WooCommerce (limitation: removes ads in the content of archive pages)
- AMP for WP – Accelerated Mobile Pages
Others might work too, but if not, please let us know.
AdSense on AMP pages
Displaying the normal AdSense code is not possible on pages based on the AMP standard. The Responsive Add-On automatically converts AdSense ads (added with the AdSense ad type) into the AMP format on AMP pages.
Due to the AMP standard, there are currently some limitations:
- only supports normal ad format and responsive with custom sizes, but not auto or other sizes
- see General limitations below
AMP ad type
Many ad networks offer support for AMP already. Since they may come with different attributes, we implemented a flexible AMP ad type into the Responsive Add-On.
When you are using this ad type, you will see a form to enter custom parameters and values. You will find the supported parameters when you click on any of the networks in the list of ad networks that already use AMP. The specific parameters and values need to be checked with your ad network.
For AdSense, it might look like this:
The AMP documentation also offers a fallback option. We implemented this as well, but couldn’t find an ad network that supports it yet.
This fallback is not meant to show up when the ad is broken or you don’t have an account with a specific network, but when the impression is not filled by the network. However, the network itself decides whether they respect this setting or not.
On the AMP page, this is described like this:
amp-ad supports a child element with the fallback attribute. If supported by the ad network, this element is shown if no ad is available for this slot.; If there is no fallback element available, the amp-ad tag will be collapsed (set to display: none) if the ad sends a message that the ad slot cannot be filled and AMP determines that this operation can be performed without affecting the user’s scroll position.
Image and other ads on AMP pages
Facebook Instant Articles & Google AMP Pages by PageFrog
When using ads on AMP pages with the mentioned plugin, please uncheck this option to allow the content injection.
Force AMP compliance by removing other plugins/functions from AMP pages
General limitations for AMP ads
- only the manual placement and placements before, within and after the content are supported, but none from Advanced Ads Pro
- cache-busting in Advanced Ads Pro does not work on AMP pages
- impression tracking only works with the methods track on load and track after page printed
- when you use the reserve this space option for the ads, it can not be centered with the Position option
- don’t use the reserve this space option when you are using an ad label for ads on your site
- some issues can occur depending on the method you used to create AMP pages. The AMP plugin by Automattic can not create AMP code for archive pages