Adding Google Ads Conversion Tracking to Shopify

Easily add Google Ads conversion tracking to Shopify in less than 15 minutes.

Step 1

Log in to your Shopify Admin Panel

Shopify Login Admin

Step 2

Click on Settings (Gear Icon) and choose Checkout

Shopify Checkout

Step 3

Login to Google Ads and click on the 3dot menu in the top right corner and select Conversions under Measurement column.

Google Adwords Menu Conversions

Click on the big blue plus sign and select website as your tracking template.

Then do the following :

  • Conversion name
    • enter any name
  • Category
    • Purchase / Sale
  • Value
    • Use different values for each conversion
  • The rest can be as default

Click on Create and continue

Create your website conversion action

There are two parts, click on download snippet for both the Global site tag and Event snippet

Go back to Shopify and scroll down until you see Order Processing (from step 2), at the bottom of this section you will have a field where you can paste code which is labeled Additional Content and Script.

Shopify Additional Scripts

First past your Global site tag such as the example below (do not use this example, use your own downloaded code snippet)

<!-- Global site tag (gtag.js) - Google Ads: 123456789123 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=xx-123456789123"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'xx-123456789123');
</script>

Then right after that we paste the event snippet, before we do this we need to edit the code. replace the following lines from your downloaded code snippet to the code example below :

  • ‘send_to’: ‘xx-123456789123/lkadsjKDweLK45W’,
    • change this line with your snippet

Code Example (change the send_to to your code snippet)

{% if first_time_accessed %}
<script>
  gtag('event', 'conversion', {
      'send_to': 'xx-123456789123/lkadsjKDweLK45W',
      'value': {{ total_price | money_without_currency | remove:',' }},
      'currency': '{{ shop.currency }}',
      'transaction_id': '{{ order.order_number }}'
  });
</script>
{% endif %}

Testing

You will need to make a test payment to check if the conversion tracking is correctly installed. When you are on the final thank you page of the checkout, use Tag Assistant to validate the code.

Need Help?