Page Summary
-
This guide explains how to set up and configure conversion measurement for AMP landing pages.
-
Accurate conversion measurement relies on passing a GCLID ("Google click identifier") from ad clicks to landing pages.
-
Since AMP pages are often served from an AMP cache domain, special tagging is needed to pass the GCLID to your domain.
-
Google Ads auto-tagging must be enabled as a prerequisite for measuring conversions.
-
Basic and advanced configurations are provided based on your AMP page's subdomain and linking structure.
This guide describes the setup and configuration needed for conversion measurement to work on AMP landing pages.
For a complete overview of AMP for Google Ads, see Using AMP for your Google Ads landing pages, a step-by-step guide to deploying AMP with Google Ads.
If you use Google Analytics, follow the steps in Set up Google Analytics session unification for AMP so that user sessions are stitched across AMP pages and the rest of your site. Configuring Google Analytics is recommended if you create Google Ads conversions based on Google Analytics key events or link Google Ads to Google Analytics.
Background
For accurate conversion measurement, ad clicks pass on a GCLID ("Google click identifier") to your landing pages. The landing pages will store the GCLID in a cookie on your domain and the GCLID parameter is then included in conversion tags on your site. Read How Google Ads tracks website conversions for more details.
Because AMP landing pages are served directly from your own domain, they can store the GCLID in a cookie on your domain. If your AMP landing pages and your conversion pages are on different domains or subdomains that cannot share cookies, you must pass the GCLID on outgoing links to your site pages using a query parameter in the URL. The tags on your site pages can then retrieve the GCLID from the query parameter and store the GCLID as a cookie on your domain.
Prerequisite
Enable Google Ads auto-tagging to measure conversions on your website across all browsers.
Basic configuration
Step 1: Tags on AMP landing pages
To use the
amp-analytics
component, start by including the required script in the <head> element of
your AMP page. You can then configure Google Ads tags with the amp-analytics
component by using either the Google tag or Google Tag Manager.
Option 1: Google tag
Using the default Google tag for AMP on your AMP landing pages with your Google Ads tag ID adds website visitors to your "All visitors" remarketing lists (if you've set up remarketing).
This configuration also stores the GCLID in a first-party cookie on your domain
and passes the GCLID by default across standard subdomains (www., m., and
amp.). In the following sample code snippet, replace
AW-CONVERSION_ID with your Google Ads tag ID (for example,
AW-123456789):
<amp-analytics type="gtag" data-credentials="include"> <script type="application/json"> { "vars" : { "gtag_id": "AW-CONVERSION_ID", "config" : { "AW-CONVERSION_ID": { "groups": "default" } } } } </script> </amp-analytics>
For the gtag_id field, you can specify the tag ID from any Google product (for
example, Google Ads or Search Ads 360) that you use on your AMP pages, but
include only one product ID in gtag_id.
Option 2: Google Tag Manager
- Create a Google Tag Manager AMP container and add the default code snippet to your AMP page.
- Add a Conversion Linker tag to your Google Tag Manager AMP container to store the GCLID in a first-party cookie on your domain and pass it across standard subdomains.
Step 2: Tags on non-AMP pages
Review the following options for tags needed on non-AMP pages. Follow the detailed instructions in How Google Ads tracks website conversions for each of the options below.
Option 1: Google tag
Follow the Google tag setup instructions:
- Place the Google tag snippet on all pages of your website.
- On conversion pages, place the event snippet anywhere in the code after the Google tag snippet.
Option 2: Google Tag Manager
On your Google Tag Manager web container:
- Create a Google Tag Manager Google Ads Conversion tag.
- Add a Conversion Linker tag to the Google Tag Manager web container and set it to fire on All Pages.
If the Tag Manager code snippet on your site pages loads in an iframe, select Enable linking across domains and Accept incoming linker parameters in your Conversion Linker tag.
Advanced configuration: Set up conversion measurement across domains
If your AMP pages are on a non-standard subdomain (that is, not www.,
m., or amp.) or link to pages on a different top-level domain, complete the
following cross-domain configuration.
Step 1: Tags on AMP landing pages
You can configure Google Ads tags with either the Google tag or Google Tag Manager.
Option 1: Google tag
- Implement the Google tag for AMP on your AMP pages.
- Add the following code snippet to your AMP page:
- Replace AW-CONVERSION_ID with your Google Ads tag ID (for
example,
AW-123456789). - In the
domainsarray, include the domain where your AMP page is hosted along with any destination domains or subdomains.
- Replace AW-CONVERSION_ID with your Google Ads tag ID (for
example,
<amp-analytics type="gtag" data-credentials="include"> <script type="application/json"> { "vars" : { "gtag_id": "AW-CONVERSION_ID", "linker": { "domains": ["subdomain1.example.com", "subdomain2.example.com", "www.example2.com"] }, "config" : { "AW-CONVERSION_ID": { "groups": "default" } } } } </script> </amp-analytics>
For the gtag_id field, you can specify the tag ID from any Google product (for
example, Google Ads or Search Ads 360) that you use on your AMP pages, but
include only one product ID in gtag_id.
Option 2: Google Tag Manager
- Create a Google Tag Manager AMP container and deploy AMP-compliant tags.
- Add a Conversion Linker tag to your AMP container.
- Select Enable linking across domains, and in Auto Link Domains, enter the domain that your AMP page is hosted on and any destination domains for outgoing links as a comma-separated list.
- Add the default Google Tag Manager AMP code snippet to your AMP page,
replacing GTM_CONTAINER_ID with your container ID (for example,
GTM-XXXXXX):
<!-- Google Tag Manager --> <amp-analytics config="https://www.googletagmanager.com/amp.json?id=GTM_CONTAINER_ID>m.url=SOURCE_URL" data-credentials="include"> </amp-analytics>
Step 2: Tags on non-AMP pages
Configure tags on your non-AMP pages with either the Google tag or Google Tag Manager.
Option 1: Google tag
- Add the following Google tag snippet to your non-AMP pages:
- Replace AW-CONVERSION_ID with your Google Ads tag ID (for
example,
AW-123456789). - In the
domainsarray, include the domain where your AMP page is hosted along with any destination domains or subdomains.
- Replace AW-CONVERSION_ID with your Google Ads tag ID (for
example,
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-CONVERSION_ID', { 'linker': { 'domains': ['subdomain1.example.com', 'subdomain2.example.com', 'www.example2.com'] } }); </script>
Option 2: Google Tag Manager
- In the Google Tag Manager web container:
- Configure your Conversion Linker tag to link across domains.
- Use the default Google Tag Manager code snippet on your non-AMP pages.
- If you use Google Analytics, configure your domains in Google Analytics Admin for cross-domain measurement.
Optional configuration
This section covers additional optional configuration that may be needed for your AMP deployment.
Conversion event on AMP pages
In most cases, the conversion will happen in subsequent pages in user journey which are likely non-AMP pages. In these cases, follow the instructions in How Google Ads tracks website conversions.
This section covers the case where you would like to measure a conversion on the AMP landing page itself.
Using Google tag
On the AMP page where you want to record a conversion, add a conversion trigger
to the triggers object. The following example shows a complete tag on an AMP
conversion page that reports a Google Ads conversion:
<!-- Google tag (gtag) --> <amp-analytics type="gtag" data-credentials="include"> <script type="application/json"> { "vars": { "gtag_id": "AW-CONVERSION_ID", "config": { "AW-CONVERSION_ID": { "groups": "default" } } }, "triggers": { "CONVERSION_LABEL": { "on": "visible", "vars": { "event_name": "purchase", "transaction_id": "", "value": 15, "currency": "USD", "send_to": "AW-CONVERSION_ID/CONVERSION_LABEL" } } } } </script> </amp-analytics>
Note the following fields in this <amp-analytics> tag:
- The
gtag_idfield contains the tag ID provided by Google Ads conversions (for example,AW-123456789), and CONVERSION_LABEL is the conversion label for the conversion action. - You can specify the tag ID from any Google product that you use on your AMP
page, but include only one product ID in the
gtag_idfield. - The
configobject needs to contain one entry for each Google product you use to measure activity on your AMP site. - If you use both Google Ads and Search Ads 360, see Technical details for Google tag and event snippet for Search Ads 360 AMP tag examples.
- In this example, the
amp-analyticscomponent fires on the pagevisibleevent. Alternatively, you can configure the conversion to fire on a different event, such as a buttonclick.
Using Google Tag Manager
In your Google Tag Manager AMP container, add Google Ads Conversion Tracking or Google Ads Remarketing tags and configure triggers for your conversion events.
Google Ads call tracking
Phone call conversion tracking is supported on AMP pages in Google Ads.
Step 1: Locate conversion configuration
To get started, set up a call asset and create a website call conversion action in your Google Ads account. After you create the conversion action, retrieve your numeric Conversion ID and Conversion Label from either the Google Tag Manager setup option or the Google tag phone snippet.
Option 1: Use the Google Tag Manager setup option in Google Ads
- Sign in to your Google Ads account, and select Goals > Conversions > Summary.
- Select + Create conversion action (or New conversion action), and create a website phone call conversion action by following Set up your phone call conversions.
- In the tag setup step, select Use Google Tag Manager.
- Copy the Conversion ID and Conversion Label to use in the AMP call tracking configuration in Step 2.
Option 2: Extract values from the Google tag phone snippet
If you select Install the tag yourself during tag setup, Google Ads generates a phone snippet similar to the following example:
<script>
gtag('config', 'AW-123456789/_ABcDEFg12hI34567jK', {
'phone_conversion_number': '1-800-123-4567'
});
</script>Extract the numeric Conversion ID (without the AW- prefix) and the
Conversion Label from the gtag('config', ...) target string:
| Phone snippet value | AMP call tracking parameter | Example value |
|---|---|---|
Numeric ID after AW- |
Conversion ID (path segment) | 123456789 |
String after / |
Conversion Label (cl query parameter) |
_ABcDEFg12hI34567jK |
Step 2: Configure the AMP call tracker
Include the amp-call-tracking
component script in the <head> element of your AMP page:
<head>
<script async custom-element="amp-call-tracking"
src="https://cdn.ampproject.org/v0/amp-call-tracking-0.1.js"></script>
</head>
To measure call conversions, wrap your click-to-call <a> link in an
<amp-call-tracking> element pointing to the Google Ads call tracking endpoint:
<amp-call-tracking config="https://www.googleadservices.com/pagead/conversion/CONVERSION_ID/wcm?cl=CONVERSION_LABEL&tel=1800-123-4567&mode=1"> <a href="tel:18001234567">+1-800-123-4567</a> </amp-call-tracking>
Replace the following:
- CONVERSION_ID: your numeric Google Ads Conversion ID without the
AW-prefix (for example,123456789). - CONVERSION_LABEL: your Google Ads Conversion Label (for example,
_ABcDEFg12hI34567jK).
The tel query parameter in the config URL must match the telephone number in
the enclosed <a> link.
Limitations
Conversion linking across different domains won't happen if a user closes out the AMP page without navigating to the next page since cross-domain linking works using link decoration.