Add a conversion tracking tag to your website

30/11/2019

When you create a conversion action in your Google Ads account, you’ll get a conversion tracking 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 you’ve first followed the instructions to create a conversion action and get your tag.

These instructions are just for conversions that happen on your website. For other kinds of conversion tracking, like apps, phone calls, or offline conversions, find the instructions here.

Before you begin

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

  • Create a conversion action in your Google Ads account. Follow these instructions to create a conversion action and get your conversion tag.
  • Have the ability to edit your website. Either you or your webmaster 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 as conversions.

Instructions

Choose the version of the conversion tracking tag you're using. You can get sitewide tag snippets from Google Ads only. We recommend you migrate to this new version. Tags from the previous version of AdWords, though, will still function. We've left instructions in case you have them installed. 

Set up conversion tracking using the global site 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 () of the page, paste your conversion tracking code: first, your global site tag, then, any event snippets that apply to the page (If you haven't already, follow these instructions to create your tag.)
  3. Save the changes to your webpage. And that's it!

Here's the HTML for a very simple webpage:

		
		
		Sample HTML File
		Paste your global site tag here.
                Paste your event snippet(s) here.
                
		
		
		
	

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

  
  
  Sample HTML File

  
  
  

  
    

  
  
  
    

Keep in mind: Transaction-specific values

If you chose "Use different values for each conversion" when creating your conversion action, you'll need to follow these instructions to edit your tag to track transaction-specific values.

Check your conversion tag

If you want to make sure your conversion tag is installed and tracking conversions correctly, or you think there may be a problem with the tag, read these instructions for checking your conversion tracking tag.

Set up conversion tracking using Javascript

  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 body tags () of the page, paste your conversion tracking tag. (If you haven't already, follow these instructions to create your tag.)
  3. Save the changes to your webpage. And that's it!

Here's the HTML for a very simple webpage:

		
		
		Sample HTML File
		
		
		Paste your conversion tracking tag here.
		
		
	

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

		
		
		Sample HTML File
		
		 
		
		
		
		
		
		
	

Keep in mind: Transaction: specific values

If you chose "The value of this conversion action may vary" when creating your conversion action, you'll need to follow these instructions to edit your tag to track transaction-specific values.

Cross-domain conversion tracking

If you want to measure activity across multiple domains, such as when your landing page domain is different than your conversion domain, you can enable cross-domain tracking by adding the following to your website code (sample only—this code won't work on your website):

		gtag('set', 'linker', {
                'domains': ['landing-destination.com', 'conversion-
                destination.com']
		});
	

Here’s how the code appears in the full snippet: