Accurate conversion tracking is the foundation of any successful Google Ads campaign. Without it, you’re essentially flying blind - unable to measure what’s working and what’s wasting your budget.
In this guide, I’ll walk you through the exact process I use to set up Google Ads conversion tracking on Shopify stores for my clients. This method ensures accurate data collection and enables enhanced conversions for better attribution.
Why Proper Tracking Matters
Before we dive into the technical setup, let’s understand why this matters:
- Accurate ROAS measurement - Know exactly which campaigns generate revenue
- Smart bidding optimization - Google’s algorithms need conversion data to optimize
- Budget allocation - Invest more in what works, cut what doesn’t
- Enhanced conversions - Recover conversions lost to cookie restrictions
Step 1: Create Your Conversion Action in Google Ads
First, we need to create the conversion action that will track purchases:
- Go to your Google Ads account
- Click Goals → Conversions → Summary
- Click + New conversion action
- Select Website
- Enter your domain and click Scan
- Click Add a conversion action manually
Configure the conversion with these settings:
- Category: Purchase
- Value: Use different values for each conversion
- Count: Every conversion
- Click-through window: 30 days
- Attribution model: Data-driven
Step 2: Set Up Google Tag Manager
While you can use Shopify’s native Google integration, I recommend Google Tag Manager for more control and flexibility.
Install GTM on Shopify
- Go to your GTM account and copy your container code
- In Shopify, go to Online Store → Themes → Edit code
- Open
theme.liquid - Paste the GTM head code right after the opening
<head>tag - Paste the GTM body code right after the opening
<body>tag
Configure the Data Layer
For accurate e-commerce tracking, you need to push purchase data to the data layer. Add this code to your checkout success page (Settings → Checkout → Additional scripts):
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'purchase',
'transaction_id': '{{ order.order_number }}',
'value': {{ checkout.total_price | divided_by: 100.0 }},
'currency': '{{ shop.currency }}',
'items': [
{% for item in checkout.line_items %}
{
'item_id': '{{ item.sku }}',
'item_name': '{{ item.title }}',
'price': {{ item.final_price | divided_by: 100.0 }},
'quantity': {{ item.quantity }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
});
</script>
Step 3: Create the Conversion Tag in GTM
Now let’s create the tag that fires the conversion:
- In GTM, go to Tags → New
- Name it “Google Ads - Purchase Conversion”
- Tag type: Google Ads Conversion Tracking
- Enter your Conversion ID and Conversion Label (from Google Ads)
- For Conversion Value, use:
{{dlv - value}} - For Transaction ID, use:
{{dlv - transaction_id}} - Currency:
{{dlv - currency}}
Create the Trigger
- Click on Triggering
- Create a new trigger
- Trigger type: Custom Event
- Event name:
purchase
Step 4: Enable Enhanced Conversions
Enhanced conversions help recover data lost due to cookie restrictions by sending hashed first-party data (email, phone, address) to Google.
- In your conversion tag, scroll to Enhanced conversions
- Check Include user-provided data
- Select Data Layer as the source
Add this to your checkout additional scripts (alongside the purchase event):
<script>
window.dataLayer.push({
'event': 'purchase',
// ... existing purchase data ...
'user_data': {
'email': '{{ checkout.email }}',
'phone_number': '{{ checkout.billing_address.phone }}',
'address': {
'first_name': '{{ checkout.billing_address.first_name }}',
'last_name': '{{ checkout.billing_address.last_name }}',
'city': '{{ checkout.billing_address.city }}',
'region': '{{ checkout.billing_address.province_code }}',
'postal_code': '{{ checkout.billing_address.zip }}',
'country': '{{ checkout.billing_address.country_code }}'
}
}
});
</script>
Step 5: Test Your Setup
Before going live, always test:
- Enable Preview mode in GTM
- Make a test purchase on your store
- Verify the purchase event fires on the thank-you page
- Check that all data (value, transaction ID) is captured correctly
- In Google Ads, verify the conversion shows in Conversions → Summary
Common Issues & Solutions
Conversion not firing
- Check that GTM is properly installed on all pages including checkout
- Verify the data layer event name matches your trigger exactly
- Ensure the checkout additional scripts section is enabled
Value showing as 0
- Check the Shopify Liquid syntax for the value variable
- Make sure you’re dividing by 100 (Shopify uses cents)
- Verify the data layer variable is correctly configured in GTM
Duplicate conversions
- Use transaction_id to deduplicate conversions
- Check you don’t have multiple conversion tags firing
Conclusion
Proper conversion tracking is not optional - it’s essential for running profitable Google Ads campaigns. By following this guide, you’ll have accurate purchase tracking with enhanced conversions enabled, giving you the data you need to optimize your campaigns and scale profitably.
If you’re struggling with your tracking setup or want a professional audit of your current implementation, feel free to reach out.
Related Posts
Why Shopify Sales and Google Ads Sales Don't Match: Understanding the Discrepancy
10 min read
Enhanced Conversions for Shopify: The Practical Setup Guide
WooCommerce Google Ads Conversion Tracking via GTM Using GTM4WP
14 min read
Need Help With Your Google Ads?
I help e-commerce brands scale profitably with data-driven PPC strategies.
Get In Touch