GA4 and Google Tag Manager on Shopify

10. 8. 2026
GA4 a Google Tag Manager na Shopify

GA4 and Google Tag Manager on Shopify are the foundation without which your e-shop's marketing is flying blind. Properly implemented tracking shows you where your orders come from, which campaigns pay off and where in the buying process you lose customers. On Shopify, however, tracking has to be set up correctly – including checkout tracking via Customer Events and GDPR-compliant consent to data collection.

In this guide, we'll walk through how to set up GA4 and GTM on Shopify, how to track e-commerce and the checkout correctly, how to handle GDPR consent and which mistakes to watch out for, so that your data adds up and you can base decisions on it.

Key takeaways

  • GA4 can be set up through the official Google & YouTube channel or through Google Tag Manager.
  • Checkout tracking on Shopify is handled through Customer Events (the former “additional scripts” are a thing of the past for new checkouts).
  • For GDPR compliance, set up consent (Consent Mode v2) connected to your cookie banner.
  • The goal is to track the entire journey: visit → product → cart → checkout → purchase, reliably and in line with the rules.
  • Poorly implemented tracking leads to double counting and meaningless data.

Table of contents

Why accurate tracking on Shopify matters

Without reliable data, you don't know which channels and campaigns make money or where in the buying process you lose customers. A properly implemented GA4 setup shows you conversions, revenue by source, checkout behavior, the products that sell best and the points where customers drop out of the purchase. That is the basis for budget decisions and for optimizing your e-shop – without it, you're just guessing what works. On the other hand, faulty tracking is worse than none at all – it leads to decisions based on meaningless numbers. And because advertising budgets are decided based on data, every tracking error translates directly into money you spend or throw out the window.

What to track on Shopify

Tracking isn't just about conversions. For data to genuinely help you make decisions, monitor several levels together. The first is traffic and its sources – where people come from (search, ads, social media, price comparison sites) and how many of them there are. The second is behavior on your e-shop – which products and pages perform best, how long people stay and how they navigate through the store.

The third and most important level is the buying journey and conversions – how many people add to cart, start checkout and complete a purchase, and what the order value is by source. It's the combination of these views that answers the key questions: which channel pays off, where customers drop out and where to invest. Without them, you're only tracking numbers that lead nowhere; with them, you get a basis for every important decision about your e-shop.

How to set up GA4 on Shopify

On Shopify, there are two main ways to set up GA4:

  1. The Google & YouTube channel. The official app connects Shopify to your Google account and sets up basic GA4 tracking, including e-commerce events. The easiest way to start.
  2. Via Google Tag Manager. A more flexible option where you manage GA4 and other tags (advertising pixels) from one place through GTM. Suitable for more advanced tracking.

The choice depends on how complex your tracking needs to be. For a basic overview, the Google & YouTube channel is enough; once you want more tags and custom events, GTM is worth it.

Checkout tracking via Customer Events

Historically, tracking scripts were added to the checkout manually via so-called additional scripts. With the new checkout architecture (Checkout Extensibility), however, this approach is a thing of the past on most plans, and checkout tracking is handled through Customer Events (customer event pixels). This is where you set up tracking of the checkout steps and the purchase so that conversions are measured reliably and only once, with no duplicates or gaps in the most important event of all – the purchase.

The checkout is the most common place for tracking errors, so it's worth setting it up carefully and testing that the purchase event fires once and with the correct order value. An error here distorts the most important numbers – revenue and return on ad spend – so it deserves the most attention.

Google Tag Manager on Shopify

Google Tag Manager works as a central tag manager: instead of inserting individual code snippets into your e-shop, you manage GA4, advertising pixels (Google Ads, Meta) and other tools from a single interface. On Shopify, GTM is added to the theme and to Customer Events for the checkout. The advantage is a clear overview and fast changes – you can add new tags without touching your e-shop's code. For more advanced e-shops, GTM is the standard.

Consent and Consent Mode (GDPR)

Data collection must comply with GDPR – which means obtaining the customer's consent and respecting their choice. Google uses Consent Mode v2 for this, which adjusts what data is collected based on the consent given. On Shopify, consent is handled through a cookie banner connected to the Shopify Customer Privacy API and Consent Mode. Setting up consent correctly is not only a legal obligation but also a prerequisite for tracking and advertising tools to work fully.

Key e-commerce events to track

For GA4 to show you the entire buying journey, you need to track the right e-commerce events. The following overview shows the most important ones that shouldn't be missing from any e-shop:

Event What it means
view_item Product detail view
add_to_cart Add to cart
begin_checkout Checkout started
add_payment_info Payment details entered
purchase Completed purchase (with order value)

The most important one is the purchase event with the correct order value – revenue and campaign ROI are calculated from it. Tracking the entire journey from product view to purchase also shows you where customers drop out, and therefore where to focus your optimization.

Step by step: setting up GA4 via GTM

  1. Create accounts for GA4 and Google Tag Manager and link them.
  2. Add GTM to Shopify – to the theme and to Customer Events for the checkout.
  3. Set up the GA4 configuration tag in GTM.
  4. Add e-commerce events (view_item, add_to_cart, begin_checkout, purchase) and pass the order value.
  5. Enable consent (Consent Mode v2) connected to your cookie banner.
  6. Test your tracking in GTM preview mode and in GA4 (DebugView) to make sure events fire once and correctly.

Server-side tracking and its benefits

A more advanced option is server-side tracking, where data is sent by a server rather than directly by the customer's browser. The advantage is greater reliability and resistance to script blocking and browser restrictions, which lets you capture conversions that would be lost with purely client-side tracking. You also get better control over what data you send and to whom.

Server-side tracking is more demanding to implement and may not pay off for every e-shop, but for larger projects with high ad spend it makes sense – more accurate data means better campaign optimization and less money wasted flying blind. The decision is individual and worth weighing against the volume and importance of tracking for your business.

How to read data in GA4

Setup itself is only half the job – the other half is knowing how to read the data. In GA4, focus mainly on conversions and revenue by traffic source (where your orders actually come from), on the purchase journey (where customers drop out) and on the performance of individual products and campaigns. These views tell you what works and where to shift your budget.

Beware of jumping to conclusions from short periods and small numbers – data needs a sufficient sample to be meaningful. Set up a few key reports that you check regularly instead of getting lost in dozens of metrics. The goal isn't to measure everything, but to correctly measure what influences your decisions.

Properly handled consent is now a prerequisite for both working tracking and GDPR compliance. On Shopify, the cookie banner connects to the Customer Privacy API and to Consent Mode v2, which controls what data is collected based on the customer's choice. When a customer declines consent, tracking is limited; when they grant it, data is collected in full.

In practice, it's important that the banner is implemented correctly and that consent is actually reflected in your tags – otherwise you risk either non-compliance with the rules or, conversely, unnecessarily missing data. Consent Mode can also do so-called conversion modeling, where Google estimates part of the lost data for users who haven't given consent. Setting up consent is therefore not just a formality “so that we have a banner”, but a real factor in the quality of your data.

Connecting Google Ads and other tools

The real power of GA4 only shows when it's connected to other tools. Linking it to Google Ads lets you pass conversions and their value, so the ad platform can optimize campaigns better and you can see your real return on investment. Similarly, Google Tag Manager lets you manage other tags – such as Meta advertising pixels – from one place.

The key is that conversions and their values are passed correctly and only once. When ad platforms receive accurate data, you spend more efficiently and your budget goes where it pays off. That's exactly why tracking and advertising go hand in hand – without clean data, even the best campaign is flying blind. Well-connected tools, on the other hand, turn tracking into a real competitive advantage.

Common tracking mistakes

  • Double tracking. Code installed twice (channel and GTM) leads to duplicate conversions.
  • Untracked checkout. Without Customer Events, the most important event is missing – the purchase.
  • Ignored consent. Without Consent Mode, you risk both GDPR non-compliance and incomplete data.
  • Wrong order value. Incorrectly passed revenue undermines your reports and campaign optimization.

Frequently asked questions (FAQ)

How do I set up GA4 on Shopify?

Either through the official Google & YouTube channel, which sets up basic e-commerce tracking, or through Google Tag Manager, which gives you more control over tags and events.

How do I track the checkout on Shopify?

Through Customer Events (customer event pixels). The former “additional scripts” are a thing of the past for new checkouts, so purchase tracking is set up this way.

Do I need consent for data collection?

Yes. Under GDPR, you must obtain consent and respect the customer's choice. Google uses Consent Mode v2 for this, connected to your cookie banner and the Shopify Customer Privacy API.

Do I need GTM, or is the Google channel enough?

For basic tracking, the Google & YouTube channel is enough. Once you want to manage more tags and custom events from one place, Google Tag Manager is worth it.

Why don't my conversions add up in GA4?

Most often because of double tracking, an untracked or incorrectly tracked checkout, or an incorrectly passed order value. The solution is a clean setup and testing of your events.

Which e-commerce events should I track in GA4?

At a minimum: product view, add to cart, checkout start and purchase with order value. These are used to calculate revenue and to show where customers drop out.

What is server-side tracking and do I need it?

It's tracking where data is sent by a server instead of the browser. It's more reliable and more resistant to blocking, but more demanding to implement – it pays off mainly for larger e-shops with high ad spend.

How do I verify that tracking works correctly?

Using preview mode in Google Tag Manager and DebugView in GA4. Check that events (especially the purchase) fire once and with the correct value.

Tracking checklist

Before you declare your tracking finished, go through this checklist. It covers the most common weak spots that cause data not to add up:

  • GA4 installed once (either the channel or GTM – not both at the same time), with no duplicate conversions.
  • Checkout tracked via Customer Events, with a purchase event and the correct order value.
  • Consent (Consent Mode v2) connected to your cookie banner and working according to the customer's choice.
  • Key e-commerce events (view_item, add_to_cart, begin_checkout, purchase).
  • Google Ads connected, with conversions and their value being passed.
  • Tested in GTM preview mode and in GA4 DebugView.

When every item checks out, you have data you can trust and build on when making decisions about your budget and optimizing your e-shop.

Why to leave tracking to an expert

Almost anyone can set up basic GA4 with a bit of effort. But the difference between “something is being tracked” and “we track correctly and trust our data” is big – and it shows exactly where money is at stake: in campaign optimization and budget decisions. Incorrectly configured tracking (duplicate conversions, an untracked checkout, ignored consent) leads to decisions based on wrong numbers, which can end up costing more than the setup itself.

As a Shopify agency, we set up tracking so that it is clean, GDPR-compliant, connected to your advertising tools – and above all, tested. The result is data you can rely on. If you want to be sure that your tracking isn't leaking and that you're not spending your budget blindly, it pays to have it built correctly from the start.

Want Shopify tracking you can trust?

We'll set up GA4 and Google Tag Manager for you, track your checkout correctly via Customer Events and configure GDPR-compliant consent. Take a look at our Shopify e-shop development and customization or book a free consultation.

Sources

Author: Miroslav Volovec, CEO of 3NODE Software s.r.o. — specialists in e-shop development and tracking on the Shopify platform.