Skip to content
Branch: master
Find file Copy path
Find file Copy path
7 contributors

Users who have contributed to this file

@glevitzky @bradfrizzell @keithwrightbos @jasti @Aerlinger @asndev @bpaduch
165 lines (140 sloc) 5.98 KB

Google Ad Manager


Description Google Ad Manager implementation of the AMP Ad tag. Click here for Fast Fetch details, and here for AMPHTML ad format details. This tag should not be directly referenced by pages and instead is dynamically loaded via the amp-ad tag. However, in order to remove an async script load of this library, publishers can include its script declaration.
Availability Launched
Required Script <script async custom-element="amp-ad" src=""></script>
Examples See Example Section

Supported Features

Feature Description Status
Multi-size Allows slots to specify multiple sizes. Launched
Fluid Fluid slots do not require a pre-specified size, but will instead fill up the width of their parent container and adjust their height accordingly. Launched
Real Time Config Allows Publishers to augment ad requests with targeting information that is retrieved at runtime. Launched
Render on Idle Allows slots 3-12 viewports down to render while the AMP scheduler is idle. Launched
Refresh Enabled slots will periodically refetch new creatives. Launched
Safeframe API An API-enabled Iframe for facilitating communication between publisher page and creative content. Launched
SRA: Single Request Architecture When enabled, all eligible slots on the page will be serviced by a single ad request. Beta
Single Page Ads Ads that appear within an AMP story, the new ad format for visual storytelling. Beta
AMP Consent Integration Integration with AMP Consent extension. Launched


Example - Google Ad Manager Ad

<amp-ad width=728 height=90


For semantics of configuration, please see ad network documentation.

Ad size

By default the ad size is based on the width and height attributes of the amp-ad tag. In order to explicitly request different ad dimensions from those values, pass the attributes data-override-width and data-override-height to the ad.


<amp-ad width=320 height=50

For multi-size attributes, see the multi-size documentation page.

Supported parameters

  • data-slot: Full path of the ad unit with the network code and unit code.
  • data-multi-size: See the multi-size documentation page for details.
  • data-multi-size-validation

Supported via json attribute:

  • categoryExclusions: Sets a slot-level category exclusion for the given label name.
  • cookieOptions: Sets options for ignoring DFP cookies on the current page.
    • 0: Enables DFP cookies on ad requests on the page. This option is set by default.
    • 1: Ignores DFP cookies on subsequent ad requests and prevents cookies from being created on the page.
  • tagForChildDirectedTreatment: Configures whether the slot should be treated as child-directed. See the TFCD article for Small Business or Premium for more details and allowed values.
  • targeting: Sets a custom targeting parameter for this slot. Values must of the form:
    • "<key_string>":"<value_string>" or
    • "<key_string>":["<value1>", "<value2>", ...]. See below for example.

Example with json attribute:

<amp-ad width=320 height=50

Supported DFP Formats

Unsupported DFP Formats

  • Interstitials
  • Flash
  • Creatives served over HTTP.
You can’t perform that action at this time.