You're running Google Ads campaigns for your Shopify store, driving traffic, but your conversions in Google Ads aren't matching your sales. This is a frustratingly common problem, often stemming from how conversion tracking is implemented (or mis-implemented) on Shopify's unique platform. Unlike traditional websites, Shopify has specific limitations, especially regarding the checkout process and the `checkout.liquid` file.
If your Google Ads conversion tracking on Shopify is broken, you're flying blind, wasting ad spend, and missing out on crucial optimization data. This guide will help you understand the common pitfalls and provide a full fix to ensure every valuable sale is tracked.
Shopify's platform is designed for ease of use, but its locked-down nature, especially the checkout pages, can make traditional tracking implementations challenging. Here are the main reasons your tracking might be failing:
gtag.js
) needs to be on all pages of your store. If it's missing or placed incorrectly, no conversion events will fire./checkouts/cn/.../thank-you
). Generic "page view" triggers might not be robust enough, or the URL matching might be incorrect.For most Shopify stores, the "Additional scripts" box in the "Order status page" section of your checkout settings is the most reliable place to implement Google Ads purchase conversion tracking.
Step-by-Step Implementation:
<!-- Google tag (gtag.js) -->
and contains your Google Ads Conversion ID (AW-XXXXXXXXX
).'send_to': 'AW-XXXXXXXXX/YYYYYYYYYY'
).This tag needs to be on every page of your store. The ideal place is within the <head>
section of your theme.liquid
file.
theme.liquid
.<!-- Google tag (gtag.js) -->
) just above the closing </head>
tag.This is where you'll ensure the purchase data is correctly sent.
Your event snippet will look something like this (simplified):
<script>
gtag('event', 'conversion', {
'send_to': 'AW-YOUR_CONVERSION_ID/YOUR_CONVERSION_LABEL',
'value': 1.0,
'currency': 'USD',
'transaction_id': ''
});
</script>
Modify it to use Shopify Liquid variables:
{% if first_time_accessed %}
<script>
gtag('event', 'conversion', {
'send_to': 'AW-YOUR_CONVERSION_ID/YOUR_CONVERSION_LABEL',
'value': {{ checkout.total_price | divided_by: 100.0 }},
'currency': '{{ shop.currency }}',
'transaction_id': '{{ order.order_number }}'
});
</script>
{% endif %}
Explanation of changes:
{% if first_time_accessed %}...{% endif %}
: This Liquid tag ensures the conversion fires only once when the customer first accesses the thank-you page, preventing duplicate conversions if the page is refreshed.'value': {{ checkout.total_price | divided_by: 100.0 }}
: This uses Shopify's checkout.total_price
Liquid object (which returns the value in cents) and divides it by 100.0 to get the correct dollar/currency value. You could also use checkout.subtotal_price
if you want to exclude tax and shipping.'currency': '{{ shop.currency }}'
: This automatically pulls your store's base currency, ensuring no currency mismatches.'transaction_id': '{{ order.order_number }}'
: This populates the transaction ID with Shopify's order number, crucial for accurate tracking and deduplication in Google Ads.Click "Save" after pasting and modifying the code.
After implementation, it's vital to test and verify everything is working correctly.
theme.liquid
just before </head>
and the event snippet is in "Additional scripts" on the checkout page.checkout.total_price | divided_by: 100.0
and shop.currency
are used correctly. Test them by temporarily displaying them on your thank-you page (e.g., <p>Total Price: {{ checkout.total_price | divided_by: 100.0 }}</p>
) to verify the values output.gtag.js
, their event parameters and setup details can differ. If you're also using GA4, ensure both are configured correctly without conflict.If you are on Shopify Plus and rely on `checkout.liquid` for complex tracking, be aware of the upcoming deprecation. Shopify is pushing for Web Pixels API and Checkout UI Extensions (for customization) as replacements. For advanced tracking needs, consider using Google Tag Manager (GTM) in conjunction with Shopify's Customer Events (Web Pixels) API, or a robust third-party tracking app like Analyzify.
Proper Google Ads conversion tracking is fundamental for successful campaigns on Shopify. By diligently following these steps and understanding the platform's nuances, you can ensure your ad spend is optimized based on accurate, real-time sales data. If you continue to face challenges, consider seeking assistance from a digital marketing expert specializing in Shopify and Google Ads tracking. At WebCareSG, we routinely help Shopify merchants ensure their tracking is flawless and their ad campaigns are performing optimally. Contact us today for a comprehensive tracking audit.
Go beyond quantitative data with website heatmaps. Discover what these visual tools are, how they complement Google Analytics by showing user clicks and scrolls, and how free, user-friendly platforms like Microsoft Clarity can unlock deeper insights into visitor behavior.
Learn how to troubleshoot the "500 Internal Server Error" step by step, with detailed insights to identify and resolve common causes of server-side issues.
How do you turn that tortoise into a hare? Let’s dive into some effective strategies that will have your website zipping along in no time!
Whatsapp us on