Google Ads Conversion Tracking for Shopify: Step-by-Step Setup Process

create google ads conversions for shopify

Are you running Google Ads on your Shopify store? Then, you already know the importance of tracking conversions. Setting up Google Ads for your store is a different thing, and setting up Google Ads conversion tracking is a whole different beast. The accuracy of the conversion data will depend on how well you set up conversion tracking.

When you create Google Ads conversions for Shopify in the right way, you’ll be able to see exactly what actions customers are taking after clicking your ads—whether they’re completing a purchase, signing up for your newsletter, or taking some other important step. With this information, you can adjust your marketing strategy to focus on what’s actually working.

In this blog, I’ll walk you through how PPC experts set up Google Ads conversion tracking on Shopify. So, let’s dive in!

Benefits of Google Ads Conversion Tracking for Shopify

Before jumping into the setup process, let’s quickly go over why setting up Google Ads conversion tracking on your Shopify store is valuable. Here are some of the key benefits:

  • Measure What Matters: Conversion tracking helps you see which ads are actually driving sales. Instead of guessing, you’ll have real data on which campaigns are successful and which ones might need tweaking.
  • Optimize Ad Spending: With clear insights into which ads generate the most conversions, you can allocate your budget more effectively. This means more money goes toward ads that work, and less is wasted on underperforming ones.
  • Understand Customer Behavior: Beyond sales, you can track other actions customers take on your site, such as adding products to the cart, starting the checkout process, or signing up for email updates. This helps you understand customer behavior and improve the user experience.
  • Boost Return on Investment (ROI): When you know which ads bring results, you can double down on what’s working. Conversion tracking lets you adjust your campaigns to maximize ROI, turning more clicks into profits.
  • Create Smarter Ad Strategies: With conversion data, you can create better-targeted ads, refine your ad copy, and choose the best keywords. This helps you craft campaigns that truly resonate with your target audience, leading to higher conversion rates.
  • Set Up Automated Bidding: Google Ads offers automated bidding strategies that adjust your bids based on your conversion data. By tracking conversions, you can take advantage of these strategies to drive more sales at a lower cost per acquisition.

Steps to Create Google Ads Conversion Tracking for Shopify

By now, you know how powerful conversion tracking can be for boosting your Shopify store’s performance. But it’s not just about data collection—it’s about knowing your customers, improving your ad spend, and driving smarter growth.

Setting up Google Ads conversion tracking for Shopify might seem technical, but I’ve broken it down into straightforward steps. So, let’s start:

Setting Up Google Ads Conversion Tracking in Shopify Manually

This method involves editing the theme’s code directly, giving you more control and flexibility. It’s perfect for those who are comfortable with a bit of coding and want to ensure the tracking code is placed precisely where it should be.

Step 1: Create a Conversion Action in Google Ads

The first step is to create a conversion action in Google Ads. This allows you to track key actions like purchases— which is essential for understanding how effectively your ads drive sales.

  • Log in to your Google Ads account.
  • Navigate to Tools & Settings > Measurement > Conversions.
  • Click + New Conversion Action and choose Website.
  • Set the category to Purchase/Sale.
  • For the conversion value, choose Use different values for each conversion—this helps track purchases accurately.
  • Once you’ve filled in the details, click Create and Continue.

Awesome! You’ve created a conversion action. Now, let’s move to the next step.

Step 2: Install the Google Tag in Your Shopify Theme Code

The Google tag needs to be added to your Shopify theme’s code to start tracking conversions. The steps differ slightly based on the type of tag you have: Google Ads (AW-) Tags or Google Analytics (G-) Tags.

For Google Ads (AW-) Tags:

  • Log in to your Shopify dashboard.
  • Go to Online Store > Themes.
  • Choose the theme you want to edit, click Actions, and select Edit Code.
  • Open the theme.liquid file and paste the tag code provided by Google. It looks like this:
<!-- Global site tag (gtag.js) - Google Ads: AW-xxx -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-xxx"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { window.dataLayer.push(arguments); }
  gtag('js', new Date());
  gtag('config', 'AW-xxx');
</script>

For Google Analytics (G-) Tags:

  • Follow the same steps to access Online Store > Themes > Edit Code.
  • Insert the tag code into the appropriate section, depending on your Google Analytics setup.
  • Save changes and use Google Analytics Real-Time reports to verify that data is tracked correctly.

Step 3: Install the Event Snippet on Your Shopify Checkout Page

Now, it’s time to add the event snippet, which tracks conversions when users complete purchases.

  • In Google Ads, set the event snippet to Page load and copy the code.
  • Go to Shopify admin > Settings > Checkout.
  • In the Additional Scripts text box, paste the event snippet below any existing code.
  • Add the Google tag above the event snippet.
  • To prevent duplicate conversions, wrap the snippet with:
{% if first_time_accessed %}
  <!-- Your event snippet code here -->
{% endif %}
  • Adjust the currency if needed—replace ‘USD’ with ‘{{ currency }}’ if your default currency is not USD.
  • Save changes.

Step 4: Make the Conversion Value Dynamic

If you’re running multiple ads with different values, you need to set dynamic conversion values for better tracking.

  • Go to Shopify admin > Settings > Checkout.
  • Locate the event snippet from Step 3 in the Additional Scripts box.
  • Replace the line starting with ‘value’ with one of the following:
  • To exclude taxes and shipping:
'value': {{ checkout.subtotal_price | divided_by: 100.0 }},
  • To include taxes and shipping:
'value': {{ checkout.total_price | divided_by: 100.0 }},
  • Save your changes.

Congratulations! Your Google Ads Conversion Tracking is now set up, and your scripts will adapt to the unique value of each transaction, giving you accurate and transparent insights.

Setting Up Google Ads Conversion Tracking via Shopify Checkout Settings

If you prefer a simpler, non-technical approach, you can use Shopify’s built-in settings to add the event snippet directly to the checkout page. This method is less complex and quicker, making it a go-to option for many Shopify users.

Step 1: Open Shopify Checkout Settings

First, log in to your Shopify admin panel, then head over to Settings. From there, select Checkout. This is where we’ll be adding our Google Ads tracking code.

Step 2: Set Up and Copy Your Google Ads Conversion Code

Next, log in to your Google Ads account.

  • Click on the Tools and Settings menu (top-right corner).
  • Under Measurement, select Conversions.
  • Click New Conversion Action and choose Website as your tracking template.
  • Enter your store’s URL and click Scan (this helps Google Ads identify your site).
  • Scroll to the bottom and select Add a Conversion Action Manually.

Now, you’ll need to fill out some details:

  • Conversion Name: Choose something like “Purchase” or “Sale” to keep things organized.
  • Category: Set this to Purchase/Sale.
  • Value: Choose Use different values for each conversion (this helps track your sales accurately).
  • Attribution Model: Google recommends using Position-Based for more balanced reporting.

Click Create and Continue, and then See Event Tag. Copy the Event Snippet code that appears—it’s what we’ll paste into your Shopify settings in the next step.

Note: Save this code in a document for future use.

To improve tracking accuracy, consider enabling Enhanced Conversions:

  • Visit Enhanced Conversions Settings or go to Tools and Settings > Conversions > Settings in Google Ads.
  • Check Turn on enhanced conversions for leads and agree to the terms and conditions.
  • Select Google Tag and click on Tag Details.
  • Choose Specify CSS Selectors or JavaScript Variables and change CSS Selectors to Global JavaScript Variable.
  • Enter the following JavaScript variables for better tracking:
  • Email: enhanced_conversion_data.email
  • Phone: enhanced_conversion_data.phone_number
  • First Name: enhanced_conversion_data.first_name
  • Last Name: enhanced_conversion_data.last_name
  • Street Address: enhanced_conversion_data.home_address.street
  • City: enhanced_conversion_data.home_address.city
  • Region: enhanced_conversion_data.home_address.region
  • Country: enhanced_conversion_data.home_address.country
  • Postal Code: enhanced_conversion_data.home_address.postal_code

The reason for using JavaScript variables is that they ensure conversion tracking data gets captured correctly on the thank-you page.

Step 3: Editing and Pasting Your Google Ads Conversion Tracking Code

Now, let’s get back to Shopify.

  • In your Checkout Settings (where we were earlier), scroll down to Order Processing.
  • You’ll see a section called Additional Scripts. If you see two fields labeled post-purchase and order status, paste the Google Ads code into the Order Status field.
  • Adjust the ‘fa_send_to’ value to match the event snippet’s value.

Here’s a basic format of the code you’ll need to adjust:

<!-- Event snippet for Shopify conversion page -->
<script>
  gtag('event', 'conversion', {
    'send_to': 'your_event_snippet_value',
    'value': 1.0,
    'currency': 'your_currency',
    'transaction_id': ''
  });
</script>

Make sure to replace ‘your_event_snippet_value’ with the actual value from your event snippet and adjust the currency if needed.

If you want to include taxes and shipping in the conversion value, adjust the settings accordingly. Use this enhanced code:

{% assign fa_send_to = 'YOUR_CONVERSION_ID' %}
{% comment %}DO NOT EDIT BELOW{% endcomment %}
{% if fa_google_coding %}{% assign fa_google_coding = true %}{%- else -%}{% assign fa_google_coding = false %}{%- endif -%}
{% assign fa_google_ids = fa_send_to | split: "/" %}
{% if fa_google_coding == false %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{fa_google_ids[0]}}"></script>
{% endif %}
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', '{{fa_google_ids[0]}}', {'allow_enhanced_conversions': true});
  var checkout = window.Shopify.checkout;
</script>
{% if first_time_accessed %}
<script>
  gtag('event', 'conversion', {
    'send_to': '{{ fa_send_to }}',
    'value': checkout.total_price_set.presentment_money.amount,
    'currency': checkout.total_price_set.presentment_money.currency_code,
    'transaction_id': '{{ order_id }}'
  });
  var enhanced_conversion_data = {
    {% unless billing_address.first_name == blank %}"first_name": "{{ billing_address.first_name }}",{% endunless %}
    {% unless billing_address.last_name == blank %}"last_name": "{{ billing_address.last_name }}",{% endunless %}
    {% unless checkout.email == blank %}"email": "{{ checkout.email }}",{% endunless %}
    {% unless billing_address.phone == blank %}"phone_number": "{{ billing_address.phone }}",{% endunless %}
    "home_address": {
      {% unless billing_address.street == blank %}"street": "{{ billing_address.street }}",{% endunless %}
      {% unless billing_address.city == blank %}"city": "{{ billing_address.city }}",{% endunless %}
      {% unless billing_address.zip == blank %}"postal_code": "{{ billing_address.zip }}",{% endunless %}
      {% unless billing_address.country_code == blank %}"country": "{{ billing_address.country_code }}"{% endunless %}
    }
  };
</script>
{% endif %}

Replace ‘YOUR_CONVERSION_ID’ with the conversion tracking ID you’re using.

Step 4: Verifying and Testing

Finally, it’s crucial to verify that everything is working correctly.

  • Go to Google Ads > Tools and Settings > Conversions to check if the status is marked as Verified.
  • Make a test purchase on your store to ensure the conversion tracking is working as expected.
  • Use Google Tag Assistant or Tag Manager to confirm that the tag fires correctly on the thank-you page.

You can use Google Tag Assistant to test whether your tag is firing correctly.

Note: The first_time_accessed logic checks if it’s the user’s first interaction, ensuring the conversion event triggers accurately, even for repeat customers using different sessions.

And that’s it! By following these steps, you’ll have Google Ads Conversion Tracking set up through Shopify’s checkout settings, giving you real insights into which ads are turning clicks into sales.

Need the best ROI out of your ad spend?

How to Properly Optimize Conversion Tracking for Shopify?

Setting up conversion tracking is just the beginning. To get the most out of your Shopify store’s performance data, you need to make sure your tracking is fully optimized. Here’s how to fine-tune your conversion tracking to ensure you’re capturing accurate data and gaining better insights for your ad strategy.

1. Enable Enhanced Conversions

Enhanced Conversions allow you to capture more detailed data about your customers’ actions, improving the accuracy of your tracking.

  • How to enable it: In your Google Ads account, go to Tools and Settings > Conversions > Settings. Enable Enhanced Conversions by following the prompts to add additional customer data fields, such as email, phone number, and address.
  • This extra data helps Google Ads create a more complete picture of your conversions, leading to better campaign optimization and smarter bidding strategies.

2. Use Dynamic Conversion Values

For a more accurate representation of your sales performance, use dynamic values that reflect the actual revenue generated from each sale. Here’s why it’s important:

  • Why dynamic values matter: Instead of setting a fixed conversion value, dynamic values let you track the exact order amount for each transaction. This approach is crucial for understanding the return on ad spend (ROAS).
  • How to implement it: In the Additional Scripts box in Shopify’s checkout settings, ensure the value field is set to reflect the exact total of each transaction, either with or without taxes and shipping, based on your preference.

3. Refine Your Attribution Model

The attribution model determines how credit is assigned to different touchpoints along the customer journey. Adjusting this can help you understand the most impactful steps in the journey.

  • Position-Based Attribution is generally recommended, as it gives equal credit to the first and last touchpoints, offering a balanced view of what’s driving conversions.
  • To adjust the attribution model, go to your Conversions settings in Google Ads and select the model that aligns best with your sales process.

4. Regularly Test Your Tags

Conversion tags can sometimes break due to website updates, changes in theme code, or even adjustments made within Google Ads.

  • How to test: Use tools like Google Tag Assistant or Google Analytics Real-Time reports to verify that your tags are firing correctly.
  • Make it a habit to run test transactions whenever you make significant changes to your site to ensure conversions are still being tracked accurately.

5. Leverage Smart Bidding Strategies

Once you have accurate conversion data flowing in, take advantage of Google Ads’ smart bidding options, such as Target CPA (Cost per Acquisition) or Maximize Conversions. These strategies automatically adjust your bids to drive the most conversions at your target cost.

  • Why it matters: With clean, reliable data, smart bidding becomes more effective, helping you achieve better results without constant manual adjustments.
  • To enable smart bidding, head to your campaign settings in Google Ads and select the bidding strategy that best fits your goals.

6. Keep an Eye on Conversion Lag

Conversion lag refers to the time it takes to record conversions after a click. It’s important to account for this when evaluating your campaign performance, as some conversions might take a few days to show up in your reports.

Check the Conversion Lag Report in Google Ads to understand the average delay between clicks and conversions. Adjust your reporting window accordingly to get a clearer view of campaign performance.

7. Use UTM Parameters for Better Tracking

UTM parameters are a great way to add extra tracking to your campaigns, helping you analyze which specific ad or campaign is driving the most traffic and conversions.

  • How to set it up: Add UTM parameters to your final URLs in Google Ads. Use tags like utm_source, utm_medium, and utm_campaign to break down your data in Google Analytics or other tracking tools.
  • This ensures you’re not only tracking conversions but also understanding which campaigns are driving the best results.

8. Analyze and Adjust Regularly

Conversion tracking isn’t a “set it and forget it” task. Regular analysis is essential for understanding trends, identifying issues, and finding new opportunities for optimization.

  • What to analyze: Look for trends in conversion rates, click-through rates, and cost per conversion.
  • What to adjust: If certain campaigns or keywords consistently drive more conversions, consider increasing their budgets or improving the ad copy to capture more traffic.

Let’s grow your business together!

FAQs on Google Ads Conversion Tracking for Shopify

How do I link my Shopify store to Google?
Go to Settings > Apps and sales channels > Google & YouTube in Shopify admin. Click Connect Google Account and allow access.
How to connect Shopify audiences to Google Ads?
In Shopify, go to Settings > Apps and sales channels > Shopify Audiences. Open the app, click the Google tab, then Generate audiences, and connect to your Google Ads account.
What does Google Ads count as a conversion?
A conversion is any action someone takes after interacting with your ad, like making a purchase or calling your business.

Final Thoughts

Setting up Google Ads conversion tracking for Shopify is a game-changer. It’s all about making smarter marketing decisions and improving ad performance.

From tracking purchases to getting insights into customer behavior, conversion tracking provides real data that helps you understand what’s working and what isn’t. By following this guide, you can set up accurate tracking that not only boosts your ad campaigns but also helps optimize your overall ad spend.

Once you’re comfortable with the setup, take advantage of advanced features like dynamic conversion values, smart bidding, and enhanced conversions to further elevate your strategy. And if you don’t have time to manage and track Google Ads performance, hire PPC experts to get the best ROI!

author
Mehul Patel is a seasoned IT Engineer with expertise as a WordPress Developer. With a strong background in Core PHP and WordPress, he has excelled in website development, theme customization, and plugin development.

Leave a comment