Guide · Tracking and data

Google Analytics 4 on Shopify: setup, settings and what to check

How to set up Google Analytics 4 on Shopify, which integration method to choose, the settings to change after install and why GA4 never matches Shopify.

Updated · 13 min read

By the ROASaurus team

The short answer
  • The standard way to add GA4 to Shopify is the Google & YouTube app: create a GA4 property and web stream, then connect the stream in the app.
  • Other methods are Google Tag Manager, a custom pixel with gtag.js, an analytics app, or server-side events through the Measurement Protocol; use one per event, never two.
  • After install, change the settings that hurt store data: data retention, unwanted referrals (PayPal, shop.app), internal traffic, cross-domain, session timeout and form tracking.
  • GA4 will not match Shopify's order count: consent, ad blockers, time zones, draft and POS orders and attribution rules all differ.
  • GA4 shows behaviour and revenue, not profit: it has no product costs, fees or most ad spend, so pair it with a profit report.

Google Analytics 4 (GA4) is Google's free analytics tool. On a Shopify store it records what visitors do (pages, products viewed, carts, checkouts, purchases) and where they came from. This guide covers the whole setup: creating the account and property, choosing an integration method, connecting it through Shopify's Google & YouTube app, the settings to change afterwards, the GA4 features that matter for a store, and why its numbers will differ from Shopify's.

How GA4 works on a Shopify store

GA4 is event-based. Every interaction is an event with parameters: page_view with the page location, view_item with the product, purchase with the order id, value and items. A tag on the page (the Google tag, gtag.js) sends these events to a web data stream in a GA4 property. GA4 groups events into sessions and users and builds the reports from them.

On Shopify the storefront (home, collections, products, cart) is your theme, and the checkout and thank-you page belong to Shopify. Scripts in checkout run only as pixels in a sandbox (Settings › Customer events). Every integration method below has to cover both parts, or the purchase never reaches GA4.

Universal Analytics, the previous version, stopped processing data on 1 July 2023. Any store still relying on an old UA- id is collecting nothing.

Create a Google Analytics account from scratch

If the business has no Google Analytics account yet:

  1. Sign in at analytics.google.com

    Use a Google account the business owns (not a freelancer's personal account), and click Start measuring.

  2. Create the account

    Name it after the company. Leave the data-sharing settings as you want them; they can change later.

  3. Create the property

    Name it after the store, and set the reporting time zone and currency to match Shopify (Settings › General in Shopify). A mismatch shifts orders between days and converts revenue.

  4. Business details and objectives

    Choose your industry and size, and pick the objective closest to online sales; GA4 uses it to choose which report collections to show first.

  5. Create a web data stream

    Choose Web, enter the store domain (your own domain, not the myshopify.com one) and keep Enhanced measurement on. Copy the measurement id (G-XXXXXXXXXX).

Create a new GA4 property on an existing account

If the business already has an account, for example from an old Universal Analytics setup or another site, add a property instead of a new account: open Admin, choose the account, click Create › Property, and continue from step 3 above. One property per store is the usual set-up. Several stores (for example one per country) can share a property only if you need a combined view and can filter by stream or hostname; separate properties keep reports simpler.

Give access to people by user, not by sharing a login: Admin › Access management, with the Viewer, Analyst, Editor or Administrator role each person needs.

Shopify GA4 integration methods compared

There are five ways to get GA4 events from Shopify. They differ in which events they send, how much control you have and how much maintenance they need.

MethodWhat it coversGood forWatch out for
Google & YouTube app (native)Page views, product views, cart, checkout and purchase events mapped from Shopify's standard eventsMost stores; no codeLimited control over parameters; events it does not send need another method
Google Tag ManagerWhatever your data layer pushes: any event, any parameterStores with a developer or an analystNeeds a data layer; checkout only through a custom pixel
Custom pixel with gtag.jsEvents you subscribe to in Shopify's Web Pixels APISpecific events the app does not sendCode to maintain; runs in a sandbox
Analytics appDepends on the app; often the full ecommerce event set with extra parametersFull event coverage without codeRemove the native integration first, or events count twice
Server-side (Measurement Protocol)Events sent from a server: purchases, refunds, offline eventsPurchases that browsers miss; refundsNeeds a client id from the browser to join the session
Pick one source per event. Running the app and GTM for the same purchase counts it twice.

Swipe the table sideways to see every column.

For tag setups beyond the app, see Google Tag Manager on Shopify. For the reports these events feed, see GA4 ecommerce reports.

Set up GA4 on Shopify with the Google & YouTube app

  1. Create the property and web stream first

    As above. Keep the measurement id ready.

  2. Install the Google & YouTube app

    In Shopify admin, add the Google & YouTube sales channel and connect the Google account that has access to the GA4 property. Connecting Merchant Center is not required for GA4.

  3. Connect the GA4 stream

    In the app, choose the option to set up Google Analytics 4 only, or open Settings › Google tags › Manage, and select your property and web stream.

  4. Complete setup

    Save. The app adds the Google tag to the storefront and the checkout through Shopify's pixel system; you do not paste code into theme.liquid.

  5. Remove old tags

    Delete any gtag.js snippet in theme.liquid, an old "Additional scripts" snippet or a GTM tag that sends the same measurement id.

  6. Verify

    Open GA4 Realtime and DebugView (or Google Tag Assistant), view a product, add it to the cart and place a test order. Each event should appear once.

The GA4 settings to change after installing

A default GA4 property works, but several defaults distort store data. Go through them once, in Admin.

1. Data retention

Admin › Data collection and modification › Data retention. The default keeps event-level data for 2 months, which limits explorations (funnels, paths, segments) to the last two months. Set it to 14 months, the maximum on a standard property. Standard reports are not affected.

2. Unwanted referrals (referral exclusions)

When a shopper pays through PayPal, a bank page or a 3-D Secure screen and comes back, GA4 can credit the purchase to that site as a referral. Admin › Data streams › your stream › Configure tag settings › List unwanted referrals. Add the domains that show up as referrals in your traffic report: typically paypal.com, shop.app, your payment provider's domains and checkout.shopify.com if it appears.

3. Configure your domains (cross-domain)

If visitors move between your own domains (for example a separate blog domain and the store), list them under Configure tag settings › Configure your domains, so the session continues instead of starting again. A Shopify store whose checkout runs on the same domain does not need extra entries for checkout.

4. Google signals

Admin › Data collection. Google signals adds data from users signed in to Google, used for demographics and remarketing audiences you share with Google Ads. Google removed it from reporting identity in 2024, so it no longer changes user counts. Turn it on only if your privacy policy and consent banner cover it.

5. Link Google Ads and Search Console

Admin › Product links. Linking Google Ads lets GA4 show campaign costs and clicks and lets you import GA4 key events and audiences into Google Ads. Linking Search Console adds the organic search queries and landing pages report. Both need admin access on both sides.

6. Tag your own campaigns with UTM parameters

Google Ads is tagged automatically through auto-tagging. Other platforms are not. Without UTM parameters, Meta, TikTok, email and influencer traffic lands in Referral or Direct. Use the same lowercase values everywhere:

A tagged ad link
https://yourstore.com/products/linen-shirt?utm_source=facebook&utm_medium=paid_social&utm_campaign=spring_sale&utm_content=video_01

GA4 groups traffic into default channel groups by these values, so utm_medium must match what GA4 expects (for example email, cpc, paid_social) for the traffic to land in the right channel.

7. Turn off form interactions in enhanced measurement

Enhanced measurement tracks form starts and submits automatically. On Shopify themes it often fires on search boxes, newsletter fields and cart forms, filling reports with meaningless form_start events. Under the stream's Enhanced measurement settings, switch Form interactions off and track the forms you care about as named events.

8. Session timeout and engaged-session timer

Configure tag settings › Show all. A session ends after 30 minutes without activity; you can raise it (up to 7 hours 55 minutes) if shoppers often compare products in another tab and come back. A session counts as engaged after 10 seconds by default; you can raise that to 60 seconds so a quick bounce is not counted as engagement. Change these once and leave them, because changes break comparisons with earlier periods.

9. Filter out internal traffic

Your team, developers and agencies browse the store all day. Under Configure tag settings › Define internal traffic, add a rule with your office IP addresses; this tags their events with traffic_type = internal. Then activate the filter under Admin › Data filters. Start it in Testing state, check the result, then set it to Active (an active filter permanently drops the data).

Example internal traffic rule (documentation IP)
Rule name: Office
traffic_type value: internal
Match type: IP address equals
Value: 203.0.113.24

Best practices for GA4 on Shopify

  • One tag per event. When you switch from the native app to GTM or an app (or back), remove the old measurement id, or every event counts twice.
  • Expect a delay. Standard reports can take 24 to 48 hours to settle. Use Realtime and DebugView to test, not yesterday's report.
  • Match time zone and currency between GA4 and Shopify.
  • Respect consent. In the EU and UK, set Google Consent Mode through your banner and Shopify's customer privacy settings. See GDPR for Shopify stores.
  • Mark the right key events. purchase is a key event by default; mark others (sign-ups, leads) only if they matter to the business.
  • Write down the setup: which method sends which event, and who has admin access.
  • Complement GA4 with a profit view. GA4 reports revenue, not what is left after product costs, shipping, fees and ad spend.

Why GA4 does not match Shopify

Shopify counts every order in its database. GA4 counts the purchase events that reached it. The gap is normal; what matters is that it is stable.

Reconciling a month of orders (a fictional store)Sample data
Orders in Shopify1,000
Draft, POS and manually created orders (no browser purchase event)−40
Visitors who declined analytics cookies−90
Ad blockers and browsers that block the tag−35
Thank-you page not loaded (closed tab, slow payment return)−15
Purchases in GA4820
Example numbers. The shares vary by country, audience and consent banner. A purchase sent server-side through the Measurement Protocol closes part of the last two gaps.

Other differences come from attribution (GA4 credits the session's source under its own model, Shopify reports the last referrer), time zones, currency conversion, test orders and refunds (Shopify subtracts them; GA4 only does if a refund event is sent). For a list of fixes, see GA4 tracking problems on Shopify.

Using GA4 for ecommerce: the reports that answer store questions

Once data flows, four groups of questions are worth asking GA4 every week:

  • Revenue and orders: Reports › Monetization › Ecommerce purchases and the Overview show revenue, purchases and average purchase revenue (your average order value).
  • Where buyers come from: Acquisition › Traffic acquisition by session default channel group, then by source / medium and campaign.
  • What they look at: Engagement › Pages and screens and landing pages; Monetization › Ecommerce purchases by item name.
  • Where they drop off: the Purchase journey and Checkout journey reports, or a funnel exploration.

GA4 can also show advertising cost when Google Ads is linked, and a lifetime value report per first-user source. Use it to find the sources that bring buyers who come back, then build audiences of high-intent visitors (viewed a product twice, added to cart without buying) and share them with Google Ads. The guide to GA4 ecommerce reports goes through each report.

GA4 features that matter for online stores

Funnels

Funnel explorations can be open (users may enter at any step) or closed (they must start at step one), trended (each step over time) and time-bound (step two within an hour of step one). You can break a funnel down by device or source and see what users did next after leaving a step.

Audience builder

Audiences combine events, parameters, sequences and time windows: "added to cart, did not purchase within 3 days", or "purchased twice". Audiences can include a membership duration and exclusions, and they are shared with linked Google Ads accounts for remarketing.

Segments and comparisons

In explorations, user, session and event segments can include sequences (A followed by B in the same session) and exclusions. In standard reports, comparisons let you put up to four segments side by side, such as mobile against desktop.

Predictive audiences and metrics

When a property has enough purchasers, GA4 offers predictive metrics (purchase probability, churn probability, predicted revenue) and ready-made audiences such as "likely 7-day purchasers". Google documents minimum volumes of purchasers and churned users before these appear, so small stores often do not see them.

Integrations and the BigQuery export

Besides Google Ads and Search Console, GA4 links to Merchant Center, Display & Video 360 and BigQuery. The BigQuery export gives you raw events to query with SQL; see Shopify data in a warehouse.

A personal interface

The report library lets editors build their own menu: collections and topics with the reports the team actually uses, so the left navigation shows a store's ecommerce reports first. The attribution settings (Admin › Attribution settings) choose the reporting attribution model and the lookback windows used in conversion reports.

Learning GA4: a short course outline

If you are new to GA4, learn it in this order rather than report by report:

PartWhat to learnDone when
1. BasicsAccounts, properties, streams, events, parameters, users and sessionsYou can explain why GA4 counts users and sessions differently from Shopify
2. IntegrationOne method for every event, storefront and checkoutA test order shows one purchase in DebugView
3. Migration and clean-upRemove old UA, duplicate and abandoned tagsEach measurement id appears once
4. SettingsRetention, referrals, internal traffic, links, UTMsThe checklist in this guide is done
5. ReportsAcquisition, engagement, monetization, retentionYou can answer "which channel brought last week's buyers"
6. ExplorationsFunnels, paths, segments, audiencesYou have one checkout funnel and one remarketing audience

Swipe the table sideways to see every column.

Google's own free courses on Skillshop and the Analytics Help Center cover each part; the official documentation is listed under sources.

What GA4 does not tell a store

GA4 shows
  • Sessions, users and engagement
  • Revenue and purchases per source and campaign
  • Product views, carts and checkout drop-off
  • Google Ads cost (when linked)
GA4 does not show
  • Profit after product cost, shipping and fees
  • Spend on Meta, TikTok and other platforms (unless imported)
  • Refunds, unless you send them
  • Orders it never received (consent, blockers, POS)

That is why most stores read GA4 next to Shopify's own reports and a profit report. See Shopify Analytics and Shopify profit tracking.

GA4 with ROASaurus

ROASaurus does not replace the GA4 tag on your storefront. It adds two things: it can send paid orders and refunds to GA4 from the server, and it reads your GA4 property back into the app next to its own first-party numbers.

In ROASaurusConnections › Tracking & destinations
  1. Open Connections › Tracking & destinations and add GA4 as a destination with your measurement id and a Measurement Protocol API secret (GA4 Admin › Data streams › Measurement Protocol API secrets).
  2. Keep the default events, Purchase and Refund, if the Google tag already runs on the site: GA4 deduplicates purchases by transaction id, but not page views or cart events. Tick page views and cart events only when the GA4 tag is not on the site.
  3. Use test mode first: events go to GA4's validation server, which checks them and records nothing. Choose the EU endpoint if you want collection in the EU.
  4. Check each delivery under Data quality › Deliveries, with its status and GA4's answer.
  5. Connect your Google account under Connections › Channels, then open Website › Search › GA4 to see sessions, users, key events, purchases and revenue per day and per default channel group, read once a day from the GA4 Data API.
The ROASaurus Mac app showing Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.
The ROASaurus iPhone app showing Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.
Data quality › Deliveries: each server event per platform with its status and the platform's answer. Fictional demo store, simulated data.

GA4 models and samples some data and depends on its own tag and consent; ROASaurus's Website › Visitors and Marketing › Attribution count from its own first-party events, so the numbers will not match exactly.

Start freeOpen the live demo14-day trial of every feature, no credit card.

Sources

  1. Google Analytics Help: Set up Analytics for a website
  2. Shopify Help Center: Setting up Google Analytics 4
  3. Google for Developers: Shopify event parameters for the Google tag
  4. Google Analytics Help: Data retention
  5. Google Analytics Help: Identify unwanted referrals
  6. Google Analytics Help: Set up cross-domain measurement
  7. Google Analytics Help: Activate Google signals
  8. Google Analytics Help: Session
  9. Google Analytics Help: Filter out internal traffic
  10. Google Analytics Help: Link Google Ads and Analytics
  11. Google Analytics Help: Link Search Console
  12. Google for Developers: Measurement Protocol (GA4)

More guides on tracking and data · All guides

FAQ

Questions, answered

More answers in the FAQ and the help center.

Does Google Analytics work with Shopify?

Yes. Shopify supports GA4 through the Google & YouTube app, and you can also use Google Tag Manager, a custom pixel, an analytics app or server-side events. Universal Analytics no longer collects data.

Why does Google Analytics not match Shopify?

Shopify counts every order; GA4 counts only the purchase events that reached it. Declined consent, ad blockers, POS and draft orders, closed thank-you pages, time zones and attribution rules all make GA4 lower or different. Aim for a stable gap rather than an exact match.

Does Shopify have built-in analytics?

Yes. Shopify Analytics has dashboards and reports on sales, orders, customers, acquisition and behaviour, with more reports on higher plans. It counts orders exactly but shows less about traffic sources and on-site behaviour than GA4.

How much does Google Analytics cost?

GA4 is free. Google Analytics 360, the paid enterprise version, adds higher limits, service levels and support; most stores do not need it.

How do I get my Shopify store indexed on Google?

Verify your domain in Google Search Console and submit the sitemap Shopify generates at /sitemap.xml. Linking Search Console to GA4 then shows the queries and landing pages that bring organic visitors.

Can I use the Google & YouTube app and Google Tag Manager together?

Yes, but not for the same events. If the app sends GA4 purchases, do not send purchases from GTM to the same property as well, or each order counts twice.

How long until data shows in GA4?

Realtime and DebugView show events within seconds. Standard reports can take 24 to 48 hours to process fully.

How do I set up GA4 ecommerce tracking on Shopify?

Create a property and web stream, connect it through the Google & YouTube app, check that view_item, add_to_cart, begin_checkout and purchase arrive with items and values, and add any missing events with GTM, a custom pixel or an app.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.