Set up conversion tracking for your website

Conversion tracking can help you see how effectively your ad clicks lead to valuable customer activity on your website, such as purchases, sign-ups, and form submissions.
This article explains how to create a conversion action to track customer actions on your website. You'll set up the conversion action in your Google Ads account and get a piece of code called a "tag." To finish setting up conversion tracking, you'll add the conversion tracking tag to your website.

Before you begin

Here's what you'll need before you can set up website conversion tracking:

  • A website: This is where you'll put the conversion tracking code, called a "tag."
  • Ability to edit website: Either you or your webmaster will need to be able to add the tag to your website.

This article goes right to the setup instructions. To learn more about how conversion tracking works and why to use it, read About conversion tracking.

Or, if you're not sure if website conversion tracking is right for you, you can find instructions for all the different kinds of conversion tracking here.

Instructions

Choose the Google Ads experience you're using. Learn more

Step 1: Create a conversion action

  1. Sign in to your Google Ads account.
  2. In the upper right corner, click the tool icon , and under "Measurement," click "Conversions.
  3. Click the plus button .
  4. Click Website.
  5. Next to “Conversion name,” enter a name for the conversion you’d like to track, such as “newsletter sign up” or “wedding bouquet purchase.” This will help you recognize this conversion action later in conversion reports.
  6. Next to “Category,” select a description for your conversion action from the drop-down. The category allows you to segment your conversions in reports, so you can see similar conversions together.
  7. Next to “Value,” select how to track the value of each conversion.
    • Use the same value for each conversion. Enter the amount each conversion is worth to your business.
    • Use different values for each conversion. Use this option if, for example, you’re tracking purchases of products with different prices. Later, when you add your conversion tracking tag, you’ll need to customize your tag to track transaction-specific values
    • Don't use a value
  8. Next to “Count,” select how to count these conversions.
    • One. This setting is best for leads, such as a sign-up form on your website, when only one conversion per ad click likely adds value for your business.
    • Every. This setting is best for sales, when every conversion likely adds value for your business.
  9. Click Conversion window. Select how long to track conversions after an ad interaction from the drop-down. The window can be 1 to 90 days. Learn more about conversion windows.
  10. Click View-through conversion window. Select how long to track view-through conversions from the drop-down. The window can 1 to 30 days.
  11. Click Include in “Conversions.” This setting—selected by default—lets you decide whether or not to include data for this conversion action in your "Conversions" reporting column. If you uncheck this setting, data will still be included in the "All conversions" column. You might want to uncheck this setting if you use Smart Bidding, and you don't want to include this particular conversion action in your bid strategy. Learn more about the "Include in 'Conversions'" setting.
  12.  Click Create and continue.

You’ll now see a screen that shows you’ve created your conversion action. Follow the instructions in the next section to set up your tag.

Step 2: Set up your conversion tracking tag

To set up website conversion tracking for the first time, you'll need to add 2 code snippets to your website: the global site tag and the event snippet.

The global site tag adds website visitors to your "All visitors" remarketing lists (if you've set up remarketing) and sets new cookies on your domain, which will store information about the ad click that brought someone to your site. Note that your Google Ads conversion tracking tag will be able to use this click information to attribute a conversion to your Google Ads campaigns. Please ensure you're providing users with clear and comprehensive information about data collection, and obtaining consent where legally required.

You must install the global site tag on every page of your website, but you need only one global site tag for each Google Ads account.

The event snippet tracks actions that should be counted as conversions. Install this snippet on site pages you'd like to track conversions for. Each conversion action has its own associated event snippet, whereas the global site tag is the same across all conversion actions within a Google Ads account.

Choose from 2 ways to install your tag

Option 1: Install the tag yourself

  1. Under “Global site tag,” select the option that best describes your situation and follow the instructions for installing the tag:​
    • I haven’t installed the global site tag on my website: Choose this option if it’s your first time setting up the tag for a conversion action in your account and you haven’t installed the global site tag from another Google product. This option shows the full global site tag. To install the tag, copy the tag code and paste it between the <head></head> tags of every page of your website.


      Here’s an example of a global site tag, where “AW-CONVERSION_ID” stands for the conversion ID that’s unique to your Google Ads account:

      <script async
      src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>

      <script>

        window.dataLayer = window.dataLayer || [];

        function gtag(){dataLayer.push(arguments);}

        gtag('js', new Date());

        gtag('config', 'AW-CONVERSION_ID');

      </script>

    • I installed the global site tag on my website from another Google product (example: Google Analytics) or from another Google Ads account: If this option applies to you, you won’t need to add the global site tag to your website again; however, for conversion tracking to work for this account, you’ll need to add the config command (the piece of code that contains your conversion ID) to every instance of the global site tag. This option shows that command, where “AW-CONVERSION_ID” stands for your account’s conversion ID:


      gtag('config', 'AW-CONVERSION_ID');

      Add the config command to every instance of the global site tag on your website, right above the </script> end tag. 

      Here’s an example of a global site tag that’s configured for both Google Analytics and Google Ads, with the config command for the Google Ads account highlighted:

      <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-CONVERSION_ID');

      </script>

    • I already installed the global site tag on my website when I created another conversion action in this Google Ads account: If this option applies to you, you don’t need to add the global site tag again to your website. Just make sure that the global site tag appears on every page of your site and confirm that the config command in each instance of the tag contains your account’s conversion ID. You’ll see your conversion ID when you select this option.

  2. (Optional) Modify the global site tag based on your preferences:   
    • If you don’t want the global site tag to add website visitors to your remarketing lists, add the highlighted portion below to your global site tag’s 'config' command:

    • gtag('config',' AW-CONVERSION_ID',{'send_page_view': false});

    • If you don’t want the global site tag to set first-party cookies on your site’s domain, add the highlighted portion below to your global site tag’s 'config' command:
    •  gtag('config',' AW-CONVERSION_ID',{'conversion_linker': false});

       We don’t recommend doing this as it will lead to less accurate conversion measurement.

  3. Copy the global site tag, then follow the instructions to add it to your website.

  4. Next to "Event snippet," select whether to track conversions on a page load or click.
    • Page load: Count conversions when customers visit the conversion page, such as a confirmation page for a purchase or sign-up. This is the default and most common option. Learn more about Google's security standards.
    • Click: Count conversions when customers click a button or link (such as a "Buy Now" button). 
  5. Copy the event snippet, then follow the instructions to add it to your website, or click Download snippet to add it later.
    • If you're tracking conversions by page load, add the event snippet to the page you're tracking.
    • If you’re tracking conversions by click, add the event snippet to the page that has the button or link you’d like to track for clicks.
  6. Click Next
  7. Click Done.
  8. If you’re tracking clicks on your website as conversions, follow these instructions to add an additional piece of code to the button or link you’d like to track. This step is required for conversion tracking to work.

Option 2: Use Google Tag Manager

Google Tag Manager is a tag management system that allows you to quickly and easily update tags and code snippets on your website. You can use Google Tag Manager to install your conversion tracking tag.

  1. Copy the Conversion ID and Conversion label (shown in this tab) for your conversion action.
  2. Follow the instructions to set up Google Ads conversion tracking in Google Tag Manager. Important: To ensure proper tracking in all browsers, make sure you add a Conversion Linker tag and configure it to fire on all of your webpages.
  3. Click Next.
  4. Click Done.
  5. If you’re tracking clicks on your website as conversions, you’ll need to complete additional setup steps in Google Tag Manager. This is required for conversion tracking to work. Choose one of the 2 options below:
  • Basic: Set up a click trigger so the conversion tracking tag fires when the relevant click occurs.
  • Advanced: Add a function call to the code for the link, button, or button image. Then, set up a custom event trigger so the conversion tracking tag fires when the event (in this case, a click) occurs.

Tip: Install the conversion tracking tag with Google Tag Manager

Instead of manually adding the conversion tracking tag to your website code, you can use Google Tag Manager to install the tag. You’ll need to provide the following information:
  • Conversion ID
  • Conversion label
You’ll find this information in the event snippet for your conversion action. In the sample snippet below, AW-CONVERSION_ID stands for the conversion ID unique to your account, while AW-CONVERSION_LABEL stands for the conversion label, which is unique per conversion action. 
<!-- Event snippet for Example conversion page -->
<script>
  gtag('event', 'conversion', {'send_to': 'AW-CONVERSION_ID/AW-CONVERSION_LABEL',
    'value': 1.0,
    'currency': 'USD'
  });
</script>

Informing your site visitors about data collection

As always, please ensure you're providing users with clear and comprehensive information about the data you collect on your websites, and getting consent for that collection where legally required.

Was this article helpful?
How can we improve it?
New Previous