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="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script> |
Examples | See Example Section |
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 |
Lazy Fetch | Allows for delaying ad request until slot is within a configurable distance from the viewport. | 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. | Launched |
Single Page Ads | Ads that appear within an AMP story, the new ad format for visual storytelling. | Launched |
AMP Consent Integration | Integration with AMP Consent extension. | Launched |
Always Serve NPA | Utilizes <amp-geo> to detect user's geo location to decide if a non-personalized ad should be requested regardless of user consent. |
Beta |
Example - Google Ad Manager Ad
<amp-ad width="728" height="90" type="doubleclick" data-slot="/6355419/Travel">
</amp-ad>
For semantics of configuration, please see ad network documentation.
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.
Example:
<amp-ad
width="320"
height="50"
data-override-width="111"
data-override-height="222"
type="doubleclick"
data-slot="/4119129/mobile_ad_banner"
>
</amp-ad>
For multi-size attributes, see the multi-size documentation page.
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.tagForUnderAgeTreatment
: Configures whether the slot should be treated as under-age of consent. See This article for more details on this and the TFCD signal.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.
ppid
: Sets a custom provided user ID for targeting. Do not set when serving responses to crawlers since this value is expected to be dynamic.
Example with json attribute:
<amp-ad
width="320"
height="50"
type="doubleclick"
data-slot="/4119129/mobile_ad_banner"
json='{"targeting":{"sport":["rugby","cricket"]},"categoryExclusions":["health"],"tagForChildDirectedTreatment":1}'
>
</amp-ad>
- Anchor Ads / Adhesion Units may be implemented using amp-sticky-ads.
- Expandable formats can now leverage the Safeframe API.
- Interstitials
- Flash
- Creatives served over HTTP.