Search
Clear search
Close search
Google apps
Main menu
true

Changes to the website conversion tracking tag

To streamline your experience with using website code across Google products, we’re making some changes to the  conversion tracking tag. Starting in October 2017, advertisers who create a website conversion action in the new AdWords experience will see a global site tag, which should be deployed site-wide, and an event snippet. The event snippet works in unison with the global site tag to track conversions. These snippets are replacing the previous conversion tracking tag.

This article explains why you should use the global site tag with the event snippet, and how to implement it properly.

Benefits

  • Faster and easier integration with other Google products: The global site tag is not only used by AdWords, but also by other Google products such as Google Analytics. If you use these products, the global site tag makes website implementation easier by providing a unified tagging experience.
  • More accurate conversion tracking: Using the global site tag sets new cookies on your domain, which will store information about the ad click that brought a user to your site. This ensures that AdWords can measure conversions more accurately. With the event snippet, you can specify which interactions with your website should be counted as AdWords conversions.
    If you use the previous conversion tracking tag, modified for a pixel-only implementation, AdWords is not able to observe all of your conversions. The global site tag and event snippet ensure that all of your conversions are accounted for.

Note that your AdWords conversion tracking tags are able to use the click information from the new cookies that are set on your domain. Please ensure you're providing users with clear and comprehensive information about data collection, and obtaining consent where legally required.

Before you begin

Keep in mind that:

  • The global site tag is currently only available for website conversions in the new AdWords experience.
  • For conversion tracking to work, you must have a global site tag on each page of your website and an event snippet for each conversion action. You’ll need to add the event snippets to the HTML code of the pages you’d like to track.

How the new conversion tracking tag works

The new conversion tracking tag consists of a global site tag and an event snippet, which work in unison to track your conversions. The event tells the global site tag when to track a conversion. You’ll see the code snippets for the global site tag and event when you create a new conversion action.

Global site tag

The global site tag snippet should be placed on all pages of your website, in the <head> section of your HTML pages. You only need one global site tag snippet across your entire website. If you installed a global site tag from a previously created conversion action from the same AdWords account, you shouldn’t add the global snippet again. You may also have a global site tag snippet obtained from a Google Analytics account or from another AdWords account. If that's the case, follow the instructions to adapt it so it works for your AdWords account.

Here's an example of the global site tag:

<!-- Global site tag (gtag.js) - Google AdWords: 123456789 -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=AW-123456789"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments)};
    gtag('js', new Date());

    gtag('config', 'AW-123456789');
  </script>

The code snippet above is an example only and won’t work on your website. When you set up conversion tracking for your website, you’ll be able to view and copy the global site tag for your account.

Event snippet

The event snippet should be installed on the conversion page itself. It can be placed anywhere in the code, after the global tag snippet. We recommend placing it within the <head> section for the best tracking accuracy.

Here’s an example of an event snippet:

    <!-- Event snippet for Example conversion page -->
    <script>
      gtag('event', 'conversion', {'send_to': 'AW-123456789/AbC-D_efG-h12_34-567',
        'value': 1.0,
        'currency': 'USD'
      });
    </script>
 

The code snippet above is an example only and won’t work on your website. When you set up conversion tracking for your website, you’ll be able to view and copy the event snippet for your account.

How to adapt an existing global site tag for your AdWords account

If you already have a global site tag on each page of your website, you can configure it to send data to multiple AdWords or Google Analytics accounts. Let’s take the example of a global site tag from a Google Analytics account. The global site tag would look like this:

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>

  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments)};
    gtag('js', new Date());

    gtag('config', 'GA_TRACKING_ID');
  </script>

To add support for your AdWords account, simply add the highlighted line to your global site tag, replacing "AW-123456789" with the unique ID supplied to you when you get your conversion tracking tags

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>

  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments)};
    gtag('js', new Date());

    gtag('config', 'GA_TRACKING_ID');
    gtag('config', 'AW-123456789');
  </script>

Once you’ve made this change, you don’t need to add the global site tag snippet obtained from your AdWords account to your website. Just add the event snippet on the page of your site where the conversion occurs. Note that you can re-use the same global snippet for multiple AdWords or Google Analytics accounts. For each additional AdWords or Google Analytics account you want your tag to support, add a new ‘config’ command that contains the ID of the account (as demonstrated in the sample code above, which has separate ‘config’ commands for Google Analytics and AdWords). 

How to use the new conversion tracking tags

Follow the steps to set up conversion tracking for your website in the new AdWords experience.

Was this article helpful?
How can we improve it?
Reach more customers with an online ad

With AdWords, you can run ads on Google to stand out on local searches. Only pay when your ad is clicked. [Learn more]

Sign Up for AdWords