How to Install Conversion Tracking Using Google Tag Manager

Conversion tracking is used to track Purchases, sign-ups, and other actions that customers are likely to complete after their visit to the website.  In order to make the conversion tracking to work, you’ll need to install the conversion tracking tag, which consists of a global site tag and an event snippet.  If installing the tag with Google Tag Manager, follow these instructions instead.

If any of your web pages are built using AMP, you’ll need to add tags to both the AMP and HTML versions.  Instructions are included for both.

HTML PAGES

  1. Install the global site tag on every page of your website.
    1. Open the HTML for each page.
    2. Choose from the following options:
      • If you haven’t installed the global site tag on your website, copy the tag below and paste it between the headtags (<head></head>):

<!– Global site tag (gtag.js) – Google Ads: 947944711 –> <script async src=”https://www.googletagmanager.com/gtag/js?id=AW-947944711“></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); gtag(‘config’, ‘AW-947944711’); </script>

See more guidelines on setting up the global site tag.

  • If you installed the global site tag on your website from another Google product (example: Google Analytics) or from another Google Ads account, copy the ‘config’ command below and add it to every instance of the global site tag, right above the </script>end tag.

gtag(‘config’, ‘AW-947944711’);

  • If you or a manager account already installed the global site tag on your website while setting up the tag for another conversion action, make sure that the tag is on every page of your website and check that the ‘config’ command has this Google Ads account’s conversion ID: AW-947944711
  1. Save the changes to your webpages.
  2. Install the event snippet on the conversion page. This is the page your customers reach on your website after they’ve completed a conversion — the “Thank you for your order” page, for example.
    1. Open the HTML for the conversion page.
    2. Copy the snippet below and paste it between the headtags (<head></head>) of the page, right after the global site tag.

<!– Event snippet for Check Out conversion page –> <script> gtag(‘event’, ‘conversion’, { ‘send_to’: ‘AW-947944711/R4FGCL-05pMBEIf6gcQD’, ‘transaction_id’: ” }); </script>

  1. Add code to dynamically pass a value to the transaction_idparameter.  When tracking purchases, sales, or leads on your website, this parameter ensures that each conversion is only counted once.

Save the changes to your webpage.

AMP PAGES

You should follow these instructions for any of the pages built using the AMP framework.

  1. Install the global site tag on every page of your website.
    1. Open the HTML for each page.
    2. Choose from the following options:
      • If you haven’t installed the global site tag on your website, add these two tags:
        1. First, copy the tag below and paste it between the headtags (<head></head>), before the AMP JS library.

<meta name=”amp-google-client-id-api” content=”gtag”> <script async custom-element=”amp-analytics” src=”https://cdn.ampproject.org/v0/amp-analytics-0.1.js“></script>

  1. Then, copy the tag below and paste it between the bodytags (<body></body>) of all of your AMP pages

<!– Global site tag (gtag) – Google Ads: 947944711 –> <amp-analytics type=”gtag” data-credentials=”include”> <script type=”application/json”> { “vars”: { “gtag_id”: “AW-947944711”, “config”: { “AW-947944711”: { “groups”: “default” } } }, “triggers”: { } } </script> </amp-analytics>

  1. See more guidelines on setting up the global site tag.
  • If you installed the global site tag on your website from another Google product (example: Google Analytics) or from another Google Ads account, copy the line below and include it in the “config” section of every instance of the global site tag.

“AW-947944711”: { “groups”: “default” }

  • If you or a manager account already installed the global site tag on your website while setting up the tag for another conversion action, make sure that the tag is on every page of your website and check that the “config” section has this Google Ads account’s conversion ID: AW-947944711
  1. Save the changes to your webpages.
  2. Install the event snippet on the conversion page. This is the page your customers reach on your website after they’ve completed a conversion — the “Thank you for your order” page, for example.
    1. Open the HTML for the conversion page.
    2. Copy the snippet below and paste it into the “triggers” section of the global site tag.

“C_bLwjSHvZ0eo”: { “on”: “visible”, “vars”: { “event_name”: “conversion”, “transaction_id”: “”, “send_to”: [“AW-947944711/R4FGCL-05pMBEIf6gcQD”] } }

  1. Add code to dynamically pass a value to the transaction_idparameter.  When tracking purchases, sales, or leads on your website, this parameter ensures that each conversion is only counted once.
  2. Save the changes to your webpage.