Use the Google tag for Google Ads conversion tracking

Note: The global site tag (gtag.js) is now the Google tag. With this change, new and existing gtag.js installations will get new capabilities to help you do more, improve data quality, and adopt new features – all without additional code. Learn more About the Google tag.

 

For subtitles in your language, turn on YouTube captions. Select the settings icon Image of YouTube settings icon at the bottom of the video player, then select "Subtitles/CC" and choose your language.


 

The Google tag works in unison with another piece of code, an event snippet or a phone snippet, to track your conversions.

To streamline your experience with using website code across Google products, you can use the Google tag to track your Google Ads conversions. When you create a website conversion action in the new Google Ads experience, you’ll see the Google tag instead of the previous conversion tracking tag. This tag should be installed on every page of your website. You’ll also have to add another piece of code, an event snippet or a phone snippet — depending on the type of conversion you’d like to track, to certain pages on your site. These snippets work in unison with the Google tag to track conversions.

This article explains why you should use the Google tag, and how to implement it properly. When you are ready you can Set up your Google tag.

If you have the previous conversion tracking tag installed on your website, it will still work; however, we recommend that you use the Google tag for more accurate conversion measurement.

Benefits

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

Note that when a user lands on your site from an ad click, your Google tag for Google Ads conversion tracking will read the ad click information and send that information to Google Ads. On subsequent pages, your Google Ads tags will be able to use the click information from the new cookies that are set on your domain.

How the Google tag works

The Google tag works in unison with another piece of code, an event snippet or a phone snippet, to track your conversions.

  • If you’re tracking website conversions, the event snippet tells the Google tag when to track a conversion.
  • If you’re tracking calls to your website, the phone snippet replaces your business phone number with a Google forwarding number.

When you set up conversion tracking for your website, you’ll be able to view and copy the Google tag for your account, as well as any snippets that should be used with the tag. The code snippets you’ll find below are examples only and won’t work on your website.

The Google tag

The Google tag snippet should be placed on all pages of your website, in the <head> section of your HTML pages. If you previously installed the Google tag while creating another conversion action from the same Google Ads account (or if a manager account had installed it while creating another conversion action in your account), you shouldn’t add the Google tag snippet again. If you installed the Google tag on your website from another Google product (example: Google Analytics) or from another Google Ads account, follow the instructions to adapt the tag so it works for your Google Ads account.

Here's an example of the Google tag:

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

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

Event snippet

For website conversion tracking to work, the event snippet should be installed on the conversion page itself. It can be placed anywhere in the code, after the Google 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-CONVERSION_ID/CONVERSION_LABEL',
        'value': 1.0,
        'currency': 'USD'
      });
    </script>

Phone snippet

The phone snippet should be added to the pages on your website where the phone number you’d like to track appears. The phone snippet should be placed before the ‘config’ command in the Google tag.

Here’s an example of a phone snippet:

<script>
gtag('set', {
'phone_conversion_number': '1-650-555-5555',
'phone_conversion_ids': ['AW-CONVERSION_ID/CONVERSION_LABEL']
});
gtag('config', 'AW_CONVERSION_ID');

</script>

How to adapt an existing Google tag for your Google Ads account

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

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

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

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

To add support for your Google Ads account, simply add the highlighted line to your Google tag, replacing “TAG_ID” with the unique ID supplied to you when you set up your conversion tracking tags.

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

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

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

To disable the collection of your data, add the highlighted gtag('set') command below to your Google tag:

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

</script>

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

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

Once you’ve made this change, you don’t need to add the Google tag snippet obtained from your Google Ads account to your website. Just add the event or phone snippet. Note that you can re-use the same global snippet for multiple Google Ads or Google Analytics accounts. For each additional Google Ads 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 Google Ads).

Security and privacy for conversion tracking

Google has strict security standards. Google Ads only collects data on sites and apps where you have configured tracking.

Ensure that you provide users with clear and comprehensive information about the data you collect on your sites, apps, and other properties. Make sure that you also get consent for that collection where required by law or any applicable Google policies governing user consent, including Google’s EU User Consent Policy.

Not sure if your tag is set up correctly? You can use Tag Assistant to check the implementation of your tag. For additional troubleshooting, visit Troubleshoot your sitewide tagging or Use Tag Assistant to troubleshoot your unverified or inactive conversion actions.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu