Google Tag Manager on Shopify: Setup & Conversion Tracking

google tag manager shopify - google tag manager shopify conversion tracking
A profile picture of Steve Pogson, founder and strategist at First Pier Portland, Maine
Steve Pogson
Published
June 23, 2025
Last Updated
August 10, 2026

Why Google Tag Manager Matters for Shopify Conversion Tracking

Google Tag Manager (GTM) on Shopify is the standard way to manage tracking codes — Google Analytics, Google Ads, Meta Pixel, and more — from a single interface instead of editing theme code every time a pixel changes. It’s also, right now, a time-sensitive setup: Shopify is removing the "Additional Scripts" box from the Thank You and Order Status pages for every remaining non-Plus store on August 26, 2026. If your purchase tracking still runs through that box, it will stop firing on that date with no warning banner beforehand — so this is worth checking even if your GTM setup has been working fine for years.

Quick Setup Overview:

  1. Create a GTM Container — get your tracking code from Google Tag Manager
  2. Install on Shopify — add the container code to theme.liquid for site-wide tracking, and connect a custom pixel through Customer Events for checkout and thank-you page tracking
  3. Configure Conversion Tags — set up Google Ads, GA4, and Meta Pixel tracking
  4. Test Implementation — verify tags fire correctly using GTM Preview mode
  5. Avoid Duplicates — disable conflicting native integrations

Without accurate conversion tracking, ad platforms are optimizing on incomplete data — which campaigns actually drove revenue is a guess rather than something you can see.

Key Benefits:

  • Track purchases across Google Ads, Meta, and other platforms from one container
  • Measure add-to-cart, sign-ups, and other custom events beyond Shopify’s default tracking
  • Manage every tracking script from a single interface instead of editing theme code per platform
  • Enable more accurate remarketing and audience building
  • Give ad platforms’ bidding algorithms cleaner data to optimize against

First Pier helps Shopify merchants set up Google Tag Manager conversion tracking that holds up as Shopify’s own tracking infrastructure changes — including the migration described below.

Infographic showing the complete Google Tag Manager setup process for Shopify stores, including GTM container creation, theme code installation, conversion tag configuration for Google Ads and GA4, testing with Preview mode, and data flow from customer actions through GTM to various marketing platforms - google tag manager shopify conversion tracking infographic

What Poor Conversion Tracking Actually Costs

Picture this: You're spending $3,000 monthly on ads, getting decent traffic, but you have no idea which campaigns actually drive sales. This scenario plays out for thousands of Shopify store owners every day, and it's exactly why google tag manager shopify conversion tracking can be a game-changer for your business.

Most e-commerce stores are flying blind when it comes to conversion attribution. Without proper tracking, you're making critical marketing decisions based on incomplete data. Research from Google's developer documentation shows that stores with accurate conversion tracking see significantly better ad spend efficiency.

When you implement google tag manager shopify conversion tracking correctly, you can see exactly which ads, keywords, and campaigns generate real revenue — and just as importantly, which ones don’t. Pausing the campaigns that look fine on ad spend alone but aren’t actually converting is usually where the savings show up first.

Accurate conversion data enables you to optimize bidding strategies based on real purchase data, identify high-value audiences that actually buy your products, reduce wasted spend on traffic that doesn't convert, and scale profitable campaigns with confidence.

For more detailed guidance on Shopify conversion tracking, check out our guide on Shopify conversion pixel setup and optimization.

How GTM Differs from Google Analytics

Think of Google Analytics as your reporting dashboard - it's where you analyze what happened on your store. Google Tag Manager is your tag deployment system that decides when and how to fire your tracking codes based on rules you define. The table below breaks down the distinction:

FeatureGoogle Tag Manager (GTM)Google Analytics 4 (GA4)
Primary FunctionManages and deploys tracking codes (tags)Collects, processes, and analyzes website data
RoleA system for triggering tagsA reporting and analytics platform
Data InteractionSends data to other platformsReceives and interprets data
Code ChangesMinimizes direct website code modificationsRequires code (tag) to be present on the site
DependencyCan deploy GA4, Google Ads, Meta Pixel, etc.Often deployed via GTM or Shopify's native integration

GTM doesn't replace Google Analytics. Instead, it makes managing multiple tracking pixels infinitely easier. Before GTM, adding Facebook Pixel, Google Ads conversion tracking, and Microsoft Ads tracking meant editing your theme code multiple times. With GTM, you install one container and manage everything from a single interface.

A reasonable default: use Shopify's native GA4 integration (the Google & YouTube channel) for your reporting needs, and use GTM for everything else — Google Ads conversions, Meta Pixel, Microsoft Ads, and any other marketing tags.

The Power of Accurate Conversion Data

Per-channel and per-campaign conversion data is what lets a store find out that, say, Google Shopping traffic converts at a meaningfully higher rate than a specific Facebook campaign — the kind of finding that changes where budget goes next month, not just how a report reads.

Accurate conversion data also feeds back into advertising platforms’ bidding algorithms. Google’s Smart Bidding, Meta’s algorithm optimization, and Microsoft’s automated bidding all rely on conversion signals to improve performance. Without clean data, these systems can’t optimize effectively — they’ll keep spending against whatever weak signal they do have.

Installing Google Tag Manager on Shopify (Step-by-Step)

This section walks through the ways to install GTM on a Shopify store, from manual installation to automated app-based solutions, plus how to configure a first GA4 tag once the container is live. Each method has its place depending on technical comfort level and specific needs.

GTM code placement in Shopify theme files - google tag manager shopify conversion tracking

First, create your Google Tag Manager account and container at tagmanager.google.com. Google will give you two code snippets - one goes in the <head> section and another in the <body> section of your pages.

Method 1 – Manual Theme Edit

This is the most common method for site-wide tracking because it gives complete control over how google tag manager shopify conversion tracking gets implemented on storefront pages.

Start with a safety net. Always duplicate your active theme before making changes. Go to Online Store > Themes, click the three dots next to your active theme, and hit "Duplicate."

Edit your theme.liquid file. Go to Online Store > Themes > Actions > Edit Code, then open the theme.liquid file. Paste your first GTM snippet right after the opening <head> tag, then paste the second snippet immediately after the opening <body> tag.

A note on checkout and thank-you page tracking: theme.liquid only covers your storefront - it never loaded on checkout, and Shopify has been phasing out code-based checkout customization entirely. checkout.liquid access was deprecated in 2023 and fully retired for Shopify Plus stores by August 2025, and Shopify is removing the "Additional Scripts" box from the Thank you and Order status pages on every remaining non-Plus store on August 26, 2026. If your GTM setup still relies on pasting snippets into Additional Scripts, treat that as a countdown - jump to the Custom Pixel section below to migrate before it stops firing.

Method 2 – Shopify Google & YouTube App

Shopify's official Google & YouTube app offers automated setup, but it's specifically designed for Google's ecosystem. The app automatically sets up conversion tracking for standard Shopify events like purchases, add-to-cart actions, and checkout starts.

The limitation is that it's Google-focused, so it won't help with Meta Pixel, Microsoft Ads, or other marketing platforms.

FeatureManual GTM InstallGoogle & YouTube App
Setup ComplexityMediumEasy
Multi-Platform SupportYesGoogle Only
Custom EventsFull ControlLimited
Checkout TrackingVia Custom Pixel (all plans)Automatic
MaintenanceManual UpdatesAuto-Updates

Method 3 – GTM App or Recipe Import

Several third-party apps bridge the gap between manual complexity and automated simplicity. These apps typically provide pre-configured GTM containers with common e-commerce tracking already set up.

Apps like Analyzify offer complete GTM setups with data layer plugins that automatically push the right information to your tags. You get the full power of GTM with support for multiple advertising platforms, but with much less technical setup required.

The trade-off is ongoing cost and dependency on the app developer to keep things updated.

Setting Up Your Core GA4 Tag Inside GTM

Once your container is installed, the first tag most stores need is the GA4 configuration tag. Here's how to set it up:

  1. Find Your GA4 Measurement ID: In Google Analytics, go to Admin > Data Streams. Click on your web data stream and copy the Measurement ID (it starts with "G-").
  2. Create a New Tag in GTM: In your GTM workspace, go to Tags > New. Name it something clear, like "GA4 Configuration – All Pages."
  3. Configure the Tag: Click Tag Configuration and choose Google Analytics: GA4 Configuration. Paste your GA4 Measurement ID into the corresponding field.
  4. Set the Trigger: Click Triggering and select Initialization - All Pages so the tag fires on every page load.
  5. Save and Test: Save the tag, then use GTM's Preview mode to confirm it fires correctly.
  6. Submit and Publish: Once confirmed, click Submit, give the version a descriptive name, and click Publish to go live.

From there, you'll layer on conversion-specific tags - Google Ads conversion, Meta Pixel purchase events, and any custom event tags - using the same tag-trigger-variable pattern.

Tracking Checkout & Thank-You Page Conversions

For years, checkout tracking depended on your Shopify plan: Plus stores edited checkout.liquid directly, while everyone else was limited to the Additional Scripts box on the order status page. That distinction no longer applies. Shopify has moved every store toward Checkout Extensibility, checkout.liquid access is gone, and Additional Scripts is being switched off for the remaining non-Plus stores on August 26, 2026.

The good news: the replacement works the same way regardless of plan, and it's arguably more reliable than either legacy method.

Additional Scripts section in Shopify checkout settings - google tag manager shopify conversion tracking

Setting Up Your Custom Pixel for GTM

Shopify's Customer Events and custom pixels system lets you track user actions across your entire store - including checkout - on every plan, no Plus subscription required. Instead of letting you edit checkout pages directly, Shopify runs your tracking code in a secure, sandboxed pixel.

Create the pixel. In Shopify admin, go to Settings > Customer events and click Add custom pixel. Shopify also offers a guided "Install Google Tag Manager" flow here: enter your GTM Container ID and Shopify will generate the head-section snippet for you, so you don't need to hand-copy it.

Connect it to Shopify's event system. Use the analytics.subscribe() function to listen for customer actions and push them into window.dataLayer for GTM to read. When someone completes a purchase, Shopify fires a checkout_completed event containing the transaction details; your pixel catches it and formats it for your marketing platforms. A basic pattern looks like this:

analytics.subscribe("checkout_completed", (event) => {
  window.dataLayer.push({
    event: "checkout_completed",
    value: event.data?.checkout?.totalPrice?.amount,
    transaction_id: event.data?.checkout?.order?.id,
  });
});

Custom pixels are an advanced, JavaScript-dependent feature, and Shopify notes that custom pixel code itself is unsupported by their team - so test thoroughly in Preview mode, and loop in a developer if your event mapping gets complex.

Beyond Purchases: Add-to-Cart & Sign-Up Events

Add-to-cart events are valuable for remarketing. Someone who adds a product to their cart has shown clear purchase intent, and accurate add-to-cart tracking is what makes cart-abandonment remarketing possible in the first place — without it, there's no reliable signal to build the campaign on.

Newsletter sign-ups represent another valuable conversion type. Email subscribers might not purchase immediately, but they're giving you permission to market to them over time.

Form submissions like contact requests can be incredibly valuable for stores that sell higher-priced items or offer custom services. These micro-conversions often indicate serious purchase intent.

Avoiding Duplicate Tags & Managing Multiple Pixels

Here's where many merchants run into trouble: duplicate tracking. It's common to find stores double- or even triple-counting conversions because they have multiple tracking implementations running simultaneously.

The most common scenario is using both Shopify's built-in Google Analytics integration AND deploying GA4 through Google Tag Manager. This creates duplicate data and inflates your conversion numbers. Shopify's native GA4 connection lives in Settings > Apps and sales channels > Google & YouTube - if you're deploying GA4 through GTM instead, disconnect the GA4 property there rather than hunting for an old "Google Analytics" field elsewhere in the admin.

Common Duplicate Tracking Scenarios:

  1. Google Analytics: Native Google & YouTube app connection + GTM deployment
  2. Google Ads: Google & YouTube app + manual conversion tags
  3. Meta Pixel: Native Meta app + GTM Meta Pixel
  4. Improved Ecommerce: Shopify's automatic tracking + custom GTM implementation

To avoid these issues, choose one method per platform and stick with it. A recommended approach:

  • Use Shopify's native GA4 integration for baseline Google Analytics reporting
  • Use GTM for Google Ads conversion tracking
  • Use GTM for Meta Pixel (or the native app for basic tracking only)
  • Use GTM for all other marketing platforms

A fresh duplicate-tracking risk to watch: starting August 17, 2026, Shopify's Google & YouTube app automatically sends several additional events to GA4 - including view_item_list, view_cart, remove_from_cart, and add_shipping_info - and enriches existing events with extra order data. If your GTM container already fires any of these events, they'll now land in GA4 twice. Unlike purchase, which Shopify deduplicates using the transaction ID, these events aren't deduplicated automatically. Audit your GTM tags against this list and either turn off the overlapping GTM versions or filter app-sent events using the new shopify_event_name parameter Shopify attaches to them.

Multi-Channel Tracking in One Container

One of GTM's biggest advantages is centralized tag management. Instead of adding individual tracking codes for each marketing platform, you can manage everything from one GTM container.

A typical structure for a google tag manager shopify conversion tracking setup looks like this:

Core Conversion Events:

  • Purchase (Google Ads, Meta, Microsoft Ads)
  • Add to Cart (remarketing audiences)
  • Checkout Started (funnel analysis)
  • Form Submissions (lead tracking)

Remarketing Tags:

  • Google Ads remarketing
  • Meta Pixel
  • Microsoft Ads UET
  • Custom audience building

The key is setting up proper triggers so each tag fires only when appropriate.

Infographic showing conversion attribution differences between Google Ads and Google Analytics tracking methods, displaying how each platform counts and attributes conversions differently, with examples of last-click vs data-driven attribution models - google tag manager shopify conversion tracking infographic

Testing, Troubleshooting, and Optimizing

Most google tag manager shopify conversion tracking setups fail not because of poor installation, but because merchants skip the testing phase. When your Google Ads bidding algorithm can't see real conversion data, you'll burn through your budget without knowing which campaigns actually drive sales.

Google Analytics DebugView showing real-time event tracking - google tag manager shopify conversion tracking

GTM Preview Mode shows you exactly what's happening behind the scenes. You can see which tags fire on each page, what data they're sending, and whether your triggers are working correctly. Preview mode also works against custom pixels, so you can validate checkout and thank-you page events the same way you validate storefront events.

Google Tag Assistant catches issues that Preview mode might miss. This Chrome extension validates your Google tags and spots common problems like missing conversion values.

GA4 DebugView shows events as they happen in real-time, letting you verify that your tracking is sending the right data with correct parameters.

Test systematically: verify your GTM container loads on every page, test each conversion event individually, and pay special attention to conversion values.

Common Issues & Quick Fixes

Tags refusing to fire usually means your trigger conditions are too restrictive or your GTM container isn't loading properly. Check Preview mode first.

Missing conversion values typically happens when the data layer isn't configured properly or currency values aren't formatted correctly. Make sure conversion values are numeric and match actual order totals.

Duplicate conversions inflate your numbers and occur when you have multiple tracking methods running simultaneously. Pick one method per platform and disable the others.

Browser blocking can prevent tags from executing. Test your tracking in incognito mode to rule out browser extensions.

Ongoing Maintenance Best Practices

Monthly maintenance should include testing your conversion flow in Preview mode, especially after theme updates. Check that conversion data in Google Ads matches Shopify Analytics.

Quarterly reviews help catch bigger issues. Audit all active tags and triggers, clean up unused variables, and review naming conventions.

Annual audits provide opportunities for major improvements. Complete a full tracking audit across all marketing platforms and look for new tracking opportunities - and whenever Shopify announces a checkout or Customer Events change, treat it as a trigger for an off-cycle audit rather than waiting for your next scheduled review.

Version control becomes critical as your GTM setup grows. Before making changes, create a new version with descriptive notes about what you're updating and why.

Frequently Asked Questions about Google Tag Manager & Shopify

Do I need Shopify Plus to use GTM for purchase tracking?

No, you don't need Shopify Plus for effective google tag manager shopify conversion tracking - and going forward, Plus doesn't grant you a different path either. Checkout.liquid access, the old Plus advantage, was deprecated in 2023 and fully phased out by August 2025.

The Customer Events custom pixel system is now the standard way to track checkout and thank-you page conversions on every Shopify plan. It's more reliable than the legacy methods because it runs inside Shopify's supported event system rather than injected page code.

What custom pixels can't do is track individual checkout steps as granularly as a fully custom implementation might. But most merchants care most about the final purchase conversion, and that's completely trackable through custom pixels on any plan.

Will Shopify's Additional Scripts box still work for tracking?

Not for much longer. Shopify already removed checkout.liquid and additional-scripts support for Plus stores by August 2025, and it's shutting off the Additional Scripts box on the Thank you and Order status pages for every remaining non-Plus store on August 26, 2026. If your purchase tracking still depends on that box, migrate to a Customer Events custom pixel before that date - the failure mode is quiet, so conversion data can degrade for weeks before it shows up in your reporting.

How do I prevent double counting when using both Shopify's Google app and GTM?

The golden rule is simple: choose one method per platform and stick with it. Never run Shopify's native integration alongside GTM tracking for the same platform.

For Google Analytics, the general recommendation is to use Shopify's native GA4 integration (via the Google & YouTube app) rather than deploying it through GTM. Shopify's built-in integration includes automatic ecommerce tracking that would take hours to rebuild manually, and as of August 2026 it sends an even broader set of events automatically.

Google Ads conversion tracking - if you're using the Google & YouTube app, don't create additional conversion tags in GTM. Pick one or the other.

Triple-counted purchases can make campaigns look far more profitable than they actually are — enough to justify budget decisions that don't hold up once the duplicate tracking gets fixed.

Can GTM slow down my Shopify store?

This is a common concern, but when configured correctly, GTM is designed to minimize performance impact. It loads scripts asynchronously, meaning they load in the background without blocking your page content from rendering.

The key is proper configuration: use specific triggers so tags only fire when needed, avoid stacking redundant custom HTML tags, and periodically review your container to remove tags you no longer use. Managed well, GTM contributes to a better user experience rather than working against it.

What's the difference between GA4 and Google Ads conversion numbers?

This is completely normal and expected. The main culprit is attribution models. Google Analytics uses last non-direct click attribution by default, while Google Ads uses last Google Ads click attribution.

Conversion windows also differ between platforms. Google Ads typically uses a 30-day click window, but GA4 can be configured differently.

Data processing speed creates temporary discrepancies too. Google Ads shows conversion data faster, while GA4 can take 24-48 hours to process everything.

The key insight: use each platform's data for its intended purpose. Use Google Ads conversion data to optimize your ad campaigns. Use GA4 data to understand overall website performance and customer behavior patterns.

Conclusion

Setting up google tag manager shopify conversion tracking properly is one of the more consequential technical decisions for a growing ecommerce store — not because of the setup itself, but because of what it unlocks. Accurate conversion data is what turns ad spend from a guess into something that can actually be optimized: not by spending more, but by finally knowing which campaigns drive sales and which ones waste budget.

We've covered everything from basic installation methods to advanced troubleshooting techniques, including the shift away from checkout.liquid and Additional Scripts toward Customer Events custom pixels. Whether you're migrating off a legacy setup before the August 2026 deadline or building tracking from scratch, you now have a clear path to reliable conversion tracking on any Shopify plan.

Start with tracking your core conversions - purchases are the most important, but don't forget about add-to-cart events and form submissions. Test everything thoroughly using GTM Preview mode. Then maintain your setup with regular audits to keep your data accurate as your business grows and as Shopify continues to evolve its native tracking.

Avoiding duplicate tracking is just as important as setting up tracking in the first place. Choose one method per platform and stick with it. Use Shopify's native integrations where they make sense, and use GTM for everything else.

At First Pier, we've built our reputation by helping Shopify merchants create conversion tracking systems that actually work. Our focus is always on practical solutions that drive real business results.

Your next steps: audit your current tracking setup to identify gaps - especially anything still relying on Additional Scripts or checkout.liquid - choose the implementation method that fits your technical comfort level, and start with purchase tracking before expanding to micro-conversions. Most importantly, test everything before going live.

Want to go deeper? Check out our detailed guides on shopify conversion pixel setup and how to setup google conversion tracking shopify for advanced techniques.

Accurate conversion data is the foundation of profitable e-commerce growth. Every day you operate without proper tracking is another day of missed opportunities and wasted ad spend. Don't let poor tracking hold your business back from reaching its full potential.

Get More Ecommerce Insights:

Free store teardown

Let's Do This!

Drop your Shopify store URL and we'll send back 3 quick wins — free, no pitch, and usually within 2 business days.

Prefer to talk? Book a call

Get your 3 quick wins

Thanks! We'll review your store and send your 3 quick wins within 2 business days.

Oops! Something went wrong while submitting the form.

No sales call required. Usually back within 2 business days. Unsubscribe anytime.