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.
- 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:
- Sign in at analytics.google.com
Use a Google account the business owns (not a freelancer's personal account), and click Start measuring.
- Create the account
Name it after the company. Leave the data-sharing settings as you want them; they can change later.
- 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.
- 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.
- 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.
| Method | What it covers | Good for | Watch out for |
|---|---|---|---|
| Google & YouTube app (native) | Page views, product views, cart, checkout and purchase events mapped from Shopify's standard events | Most stores; no code | Limited control over parameters; events it does not send need another method |
| Google Tag Manager | Whatever your data layer pushes: any event, any parameter | Stores with a developer or an analyst | Needs a data layer; checkout only through a custom pixel |
| Custom pixel with gtag.js | Events you subscribe to in Shopify's Web Pixels API | Specific events the app does not send | Code to maintain; runs in a sandbox |
| Analytics app | Depends on the app; often the full ecommerce event set with extra parameters | Full event coverage without code | Remove the native integration first, or events count twice |
| Server-side (Measurement Protocol) | Events sent from a server: purchases, refunds, offline events | Purchases that browsers miss; refunds | Needs a client id from the browser to join the session |
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
- Create the property and web stream first
As above. Keep the measurement id ready.
- 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.
- 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.
- 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.
- 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.
- 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:
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).
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.
purchaseis 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.
| Orders in Shopify | 1,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 GA4 | 820 |
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:
| Part | What to learn | Done when |
|---|---|---|
| 1. Basics | Accounts, properties, streams, events, parameters, users and sessions | You can explain why GA4 counts users and sessions differently from Shopify |
| 2. Integration | One method for every event, storefront and checkout | A test order shows one purchase in DebugView |
| 3. Migration and clean-up | Remove old UA, duplicate and abandoned tags | Each measurement id appears once |
| 4. Settings | Retention, referrals, internal traffic, links, UTMs | The checklist in this guide is done |
| 5. Reports | Acquisition, engagement, monetization, retention | You can answer "which channel brought last week's buyers" |
| 6. Explorations | Funnels, paths, segments, audiences | You 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
- Sessions, users and engagement
- Revenue and purchases per source and campaign
- Product views, carts and checkout drop-off
- Google Ads cost (when linked)
- 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.
Connections › Tracking & destinations- 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).
- 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.
- 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.
- Check each delivery under Data quality › Deliveries, with its status and GA4's answer.
- 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.

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
- Google Analytics Help: Set up Analytics for a website
- Shopify Help Center: Setting up Google Analytics 4
- Google for Developers: Shopify event parameters for the Google tag
- Google Analytics Help: Data retention
- Google Analytics Help: Identify unwanted referrals
- Google Analytics Help: Set up cross-domain measurement
- Google Analytics Help: Activate Google signals
- Google Analytics Help: Session
- Google Analytics Help: Filter out internal traffic
- Google Analytics Help: Link Google Ads and Analytics
- Google Analytics Help: Link Search Console
- Google for Developers: Measurement Protocol (GA4)