Integrating with AMP to serve display ads
Important: this documentation is not applicable to your currently selected format websites!
This guide is for ad networks that want to integrate with AMP to serve display ads to AMP pages.
As an ad server, you can integrate with AMP to serve traditional HTML ads to AMP pages, as well as serving AMPHTML ads.
Want to serve traditional HTML ads?
Want to serve AMPHTML ads?
amp-ad(i.e., if you haven't already created one to serve traditional HTML ads).
- Create a Fast Fetch integration to serve AMPHTML ads.
amp-ad tag to request ads from your ad server.
amp-adimplementation to display traditional HTML ads and AMPHTML ads.
For example, the Amazon A9 server can be invoked by using following syntax:
<amp-ad width="300" height="250" type="a9" data-aax_size="300x250" data-aax_pubname="test123" data-aax_src="302"> </amp-ad>
In the above code, the
type attribute specifies the ad network, which in this case is A9. The
data-* attributes are dependent on the parameters that the Amazon's A9 server expects to deliver an ad. The
amp-ad tag are appended to the URL to return an ad.
Fast Fetch is an AMP mechanism that separates the ad request from the ad response, allowing ad requests to occur earlier in the page lifecycle, and rendering ads only when they are likely to be viewed by users. Fast Fetch provides preferential treatment to verified AMPHTML ads over traditional HTML ads. Within Fast Fetch, if an ad fails validation, that ad is wrapped in a cross-domain iframe to sandbox it from the rest of the AMP document. Conversely, an AMPHTML ad passing validation is written directly into the page. Fast Fetch handles both AMP and non-AMP ads; no additional ad requests are required for ads that fail validation.
To serve AMPHTML ads from your ad server, you must provide a Fast Fetch integration that includes:
- Supporting SSL network communication.
- Validating and signing the creative through a validation service. Cloudflare provides an AMP ad verification service, enabling any independent ad provider to deliver faster, lighter, and more engaging ads.
For instructions on creating a Fast Fetch integration, see the Fast Fetch Network Implementation Guide.