Add a Google tag to your website

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.

When you create a conversion action in your Google Ads account, you’ll get a Google tag to add to your website. This tag tracks when someone who’s clicked your ad goes to your website and completes an action that you’ve defined as valuable, such as a purchase or sign-up.

This article explains how to add the tag to your website. Before you begin, make sure that you’ve first followed the instructions to set up conversion tracking for your website.

These instructions are just for conversions that happen on your website. Learn more about different ways to track conversions.

There are two ways to set up conversion tracking:

Create a conversion action Set up your Google tag
An animated GIF demonstrating how to create a new conversion action for your website. An animation demonstrating the Tag ID and Destination ID on Google tag.

Before you begin

Before you can add a conversion tracking tag to your website, you'll need to do the following:

  • Create a conversion action in your Google Ads account. To create a conversion action and get your conversion tag, follow the instructions in set up conversion tracking for your website.
  • Have the ability to edit your website. Either you or your web developer will need to be able to add the tag to your website code.
  • Identify a conversion page on your website. The instructions in this article are for tracking when someone reaches a new page on your website after completing a conversion. For example, this can be a 'Thank you for your order' page that a customer sees after making a purchase. If you want to track when someone clicks a link or button instead, follow the instructions to track clicks on your website as conversions.

Instructions

Set up conversion tracking using the Google tag

  1. Open the HTML for the page your customers reach on your website after they've completed a conversion – the 'Thank you for your order' page, for example. This is called the conversion page.
  2. Between the head tags (<head></head>) of the page, paste your conversion tracking code: first, your Google tag, then, any event snippets that apply to the page (If you haven't already, follow these instructions to create your tag.) An animation that demonstrates how to install the Google site tag for conversion tracking in Google Ads.
  3. Save the changes to your web page.

Here's the HTML for a very simple web page:

		<html>
		<head>
		<title>Sample HTML File</title>
		Paste your Google tag here.
                Paste your event snippet(s) here.
                </head>
		<body>
		</body>
		</html>
	

Here's the same web page after the conversion tracking tag has been added (sample only – this code won't work on your website):

  <html>
  <head>
  <title>Sample HTML File</title>

  <!-- Google tag (gtag.js) - Google Ads: 123456789 -->
  <script async src="https://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 Example conversion page -->
    <script>
      gtag('event', 'conversion', {'send_to': 'AW-123456789/AbC-D_efignoredh12_34-567',
        'value': 1.0,
        'currency': 'USD'
      });
    </script>

  </head>
  <body></body>
  </html>
    

Bear in mind: Transaction-specific values

If you chose 'Use different values for each conversion' when you set up conversion tracking for your website, you'll need to follow these instructions to edit your tag to track transaction-specific values.

Check your conversion tracking tag

If you want to make sure that your conversion tracking tag is installed and tracking conversions correctly, or you think that there may be a problem with the tag:

Use the following instructions to check your conversion tracking tag.

  1. In your Google Ads account, click the Goals icon Goals icon.
  2. Click the Conversions drop-down in the section menu.
  3. Click Summary.
  4. In the conversion actions table, find the conversion action that you want to check, then look at the 'Tracking status' column in that same row.

Learn more about setting up conversion tracking tag

Related links

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
7993195736372859351
true
Search Help Centre
true
true
true
true
true
73067
false
false
false