Google Ads conversion tracking

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

Learn more about conversion settings from Google Ads Help.

Requirements

Before setting up custom Google conversion tracking through edits to the theme code or through a third-party app, ensure that you don't already have conversion tracking events set up in your Google Ads account. If you're using Shopify's Google & YouTube channel, then the channel automatically adds conversion tracking events to your Google Ads account during setup.

If you set up custom tracking on top of an existing conversion tracking configuration, 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 deactivate duplicated conversion tracking events from your Google Ads account. If you need to deactivate duplicated conversion tracking events from your Google Ads account, then make sure you deactivate only the duplicated tracking events. Deactivating non-duplicate conversion events can decrease ad tracking accuracy and efficiency.

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 Google 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. Tracking purchases helps you understand how effective your ads are at generating sales on your online store To track purchases, 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 Google tag

After you create a conversion action, you need to install the Google tag in your Shopify theme code. The steps you need to follow will differ depending on your tag's ID (starting with AW- or G-).

Follow the instructions on adding your Google tag manually on Google Ads Help.

Step 3: Install the event snippet

After you install the Google 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 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. Copy the Google tag used in the Install the Google tag step. Add this tag above the event snippet that you added in step 4.
  6. 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 one time per customer:
    1. On the line before the snippet, paste {% if first_time_accessed %}.
    2. On the line after the snippet, paste {% endif %}.
  7. The default currency is USD. If you don't sell in US dollars, then replace 'USD' in the event snippet with '{{ currency }}'.
  8. The default transaction ID is blank. To prevent Google Ads from recording duplicate conversions, next to 'transaction_id': replace '' with '{{ order_id }}'.
  9. Click Save.

After making these changes, your script should look similar to the following example:

{% if first_time_accessed %}
  <!-- Event snippet for Test conversion page -->
  <script>
    gtag('event', 'conversion', {
      'send_to': '1234567',
      'value': 1.0,
      'currency': '{{ currency }}',
      'transaction_id': '{{ order_id }}',
    });
  </script>
{% endif %}

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. Although both ads generate a similar number of clicks and sales on his online store, the value of the purchases made by people who click 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 Additional scripts text box, find the event snippet that 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 | divided_by: 100.0 }},
    2. To include taxes and shipping in the conversion amount, replace it with this snippet: 'value': {{ checkout.total_price | divided_by: 100.0 }},
  4. Click Save.

After making this change, your script should look similar to the following example:

{% if first_time_accessed %}
  <!-- Event snippet for Test conversion page -->
  <script>
    gtag('event', 'conversion', {
      'send_to': '1234567',
      'value': {{ checkout.subtotal_price | divided_by: 100.0 }},
      'currency': '{{ currency }}',
      'transaction_id': '{{ order_id }}',
    });
  </script>
{% endif %}

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 display 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 Partner to edit your theme's code for you.

For more help using remarketing or dynamic remarketing for your online store, visit Google Ads Help.

Ready to start selling with Shopify?Try it free