We're constantly trying to improve your support experience, and your feedback is extremely valuable to us.

Please take a moment to tell us about your experience today.
Sign up for future Help Center user research studies.

Google Ads conversion tracking

You can use Google Ads conversion tracking to track actions that people take on your website after clicking on one of your ads. For example, with Google Ads conversion tracking set up, you can see which one of your Google Ads advertisements generates the most sales on your online store.

If you're using the Google Shopping app in Shopify, then make sure not to duplicate conversion tracking for your store.The Google Shopping app automatically adds conversion tracking events to your Google Ads account when you set it up. If you set up custom Google conversion tracking through edits to the theme code or through a third-party app, then your store might have duplicated conversion tracking events. Duplicated conversion tracking can cause inaccurate report data and problems with ad optimization. When you set up custom tracking, you can disable duplicated conversion tracking events from your Google Ads account. Learn more about conversion settings from Google Ads Help.

Requirements

Before following this guide, you need to:

  • Have a Google Ads account
  • Be running, or planning to run, an ad through Google Ads

Setting up Google Ads conversion tracking

To set up Google Ads conversion tracking, you need to create a conversion action, install the global site tag, and then add the event snippet. If you’re tracking purchases, then you also need to edit the event snippet to adjust the value of the conversion based on the purchase amount.

Step 1: Create a conversion action in Google Ads

To set up Google Ads conversion tracking, follow the Google Ads instructions for creating a conversion action.

The most common kind of conversion action is tracking purchases. To track purchases so you can see how effective your ads are at generating sales on your online store, set the category to Purchase/Sale, and the value to Use different values for each conversion.

When you’re done creating your conversion action, click CREATE AND CONTINUE.

Step 2: Install the global site tag

After you create a conversion action, you need to install the global site tag in your Shopify theme code.

Steps:

  1. When you get to the Set up the tag step in Google Ads, click Install the tag yourself.
  2. In the Global site tag section, select the option that applies. The generated code depends on your selection.
  3. Copy your global site tag.
  4. In another browser window, open your Shopify admin and click Online Store.
  5. Click Actions > Edit code.
  6. Open your theme.liquid file.
  7. If this is the first time you’ve installed a global site tag, then paste the copied global site tag between the <head> and </head> tags to apply the tag to every page in your store:
    Conversion tracking step 2b
    If you’re editing a global site tag that you’ve already installed, then locate the global site tag in your theme.liquid file and change the code as suggested by Google Ads.
  8. Click Save.

Step 3: Install the event snippet

After you install the global site tag, you need to add the event snippet to your checkout page. The event snippet tracks a conversion any time somebody clicks one of your ads and then later reaches the checkout page on your online store.

Steps:

  1. In Google Ads, in the Event snippet section, select Page load.
  2. Copy the event snippet code.
  3. In another browser window, open your Shopify admin and click Settings > Checkout.
  4. In the Order processing section, in the Additional scripts text box, paste the event snippet. If you already have code in the Additional scripts text box, then add the event snippet on a new line below the existing code.
  5. If a customer reloads the checkout page, then Google Ads might record a duplicate conversion. To prevent duplicate conversions, add tags before and after the event snippet so that it triggers once per customer:
    1. On the line before the snippet, paste {% if first_time_accessed %}.
    2. On the line after the snippet, paste {% endif %}.
  6. The default currency is USD. If you don't sell in US dollars, then replace 'USD' in the event snippet with '{{ shop.currency }}'.
  7. The default transaction ID is blank. To prevent Google Ads from recording duplicate conversions, next to 'transaction_id': replace '' with '{{ order_number }}':

    Google Ads conversion tracking event snippet configured

  8. Click Save.

Step 4: Make the conversion value dynamic

If the conversion action you’re tracking is purchases on your online store, then the value of each conversion is different.

For example, Andy owns an apparel store, and is running two different ads through Google Ads - one for his collection of watches, and one for his collection of T-shirts. While both ads generate a similar number of clicks and sales on his online store, the value of the purchases made by people who click on the watch collection advertisement is higher. The value is higher because customers buy more expensive items after they click that ad. Andy uses this information to decide where to spend his advertising dollars.

To track a different value for each conversion, you need to edit your event snippet to use values that are specific to each transaction.

Steps:

  1. Open your Shopify admin and click Settings > Checkout.
  2. In the Order processing section, in the Additional scripts text box, find the event snippet you added in Step 3: Install the event snippet.
  3. Replace the line beginning with 'value': with one of the following snippets:

    1. To exclude taxes and shipping from the conversion amount, replace it with this snippet:
          'value': {{ checkout.subtotal_price | money_without_currency }},
      
    2. To include taxes and shipping in the conversion amount, replace it with this snippet:
          'value': {{ checkout.total_price | money_without_currency }},
      

    After you replace the line, your script looks similar to the following example:

    Google Ads event snippet configured

  4. Click Save.

To make sure your tag is working, check the tracking status on the Conversion actions page in your Google Ads account. It might take a few hours for the conversion tracking tag to show as verified.

Setting up remarketing

Remarketing helps you target ads to people who visited your store in the past. Dynamic remarketing targets ads to your store's visitors based on the specific products they viewed on your site. You complete most of the setup for remarketing and dynamic remarketing through your Google Ads account. Read Google's setup guides for remarketing and dynamic remarketing to set up the remarketing code on Google.

You need to edit your theme code to add the remarketing code to your Shopify store. This is an unsupported theme customization, but you can try to find help in the Shopify Community forums, or hire a Shopify Expert to edit your theme's code for you.

Ready to start selling with Shopify?

Try it free