Google Analytics 4 on Shopify: Set It Up and Check It Works

To set up Google Analytics 4 on Shopify, create a GA4 property with a web data stream in Google Analytics, then install Shopify’s Google & YouTube sales channel and connect the property there; Shopify then sends ecommerce events such as purchases to GA4 automatically. You do not need to connect Google Merchant Center for this, and you do not paste any code into your theme. Expect GA4’s numbers to differ from Shopify’s reports: GA4 depends on cookies and consent, while Shopify counts every order.
Shopify facts come from the Help Center page on setting up Google Analytics, read on October 23, 2026.
Set up GA4 in four steps
Step 1: a Google account and an Analytics account. If you already use Gmail or Google Ads, use the same Google account. Then create an Analytics account at analytics.google.com.
Step 2: a GA4 property and a web data stream. In the Analytics account, create a GA4 property for your store (or move one you made earlier), then create a web data stream for your store’s domain. Copy the Tag ID that starts with G-; you need it in the next step.
Step 3: GA4 tags through Google & YouTube. Install the Google & YouTube sales channel from the Shopify App Store. Shopify prompts you to install it if you start the GA4 setup without it. Then follow Google’s “Shopify: Set up your Google tag” instructions inside the channel to connect your GA4 property. Connecting Merchant Center is not required for this step. Check before you connect:
- Your store must not be in private (password) mode; GA4 can’t track events until you turn it off.
- If you or an agency pasted a Google tag into your theme before, we would remove it once the channel’s tag is live, so the two don’t both send page views and purchases.
Step 4: link Google Ads. If you advertise on Google, link the GA4 property to your Google Ads account in Google Analytics. That lets Ads use GA4 key events and audiences built from your store’s visitors.
Universal Analytics stopped processing data on July 1, 2023, and its interface closed after July 1, 2024. If an old guide asks for a UA- code, it is out of date; Shopify’s migration page lists the steps to recreate UA audiences and conversion tracking in GA4.
What Shopify sends to GA4
Once the tags are connected, Shopify says “certain ecommerce events are tracked automatically”. These are the shopping steps that feed GA4’s ecommerce reports, and you do not set them up by hand. Google’s Shopify event parameters reference, read on October 31, 2026, lists eleven: page_view, view_item_list, view_item, search, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. The Google & YouTube channel also sends GA4’s standard session_start, user_engagement and first_visit events. Google’s Shopify tag guide adds that you can filter this data in GA4 by the shopify_event_name parameter. Other recommended or custom events (a newsletter sign-up, a click on a size guide) need to be added separately, and Google’s documentation covers recommended and custom events.
Shopify runs tracking scripts like these in its pixels sandbox. The sandbox cannot scrape page content, so events that depend on reading the page, such as scroll depth or clicks on outbound links, are not collected automatically. They have to be published as custom events by a developer.
Check that it works
- Place a test order with a real payment method on a low-priced product, then refund it.
- Open the Realtime report in GA4 while you browse your store in a private window. Your visit and its page views should appear there.
- Look for the purchase in GA4’s ecommerce reports the next day, since standard reports fill more slowly than Realtime.
- Compare one day of orders in GA4 with the same day in Shopify’s Analytics > Reports. Expect some gap (see below); if GA4 shows double the orders or almost none, look for a duplicate tag or a consent banner that blocks all tracking.
If nothing arrives at all, check private mode first, then whether the property in the channel is the one you are looking at in Analytics.
Why GA4 and Shopify numbers differ
Expect differences, and decide which number answers which question:
| Question | Use |
|---|---|
| How many orders and how much revenue? | Shopify reports. They count every order, including canceled and pending ones, and exclude test orders |
| Which pages and content do visitors use? | GA4 |
| Which channel brought the sale? | Shopify’s marketing reports for orders; GA4 for comparing with Google Ads |
| How many visitors? | Neither exactly: both rely on cookies, with different rules |
The main reasons for the gap:
- Consent. In markets that require consent, usually the EEA and the UK, Shopify runs pixels only for visitors who gave the required permissions. Visitors who decline are invisible to GA4 but still place orders in Shopify.
- Blockers and browsers. Ad blockers and browser privacy settings stop some tags from loading.
- Attribution rules. GA4 and Shopify credit sales to channels with different default models. Shopify’s marketing reports let you choose last click, first click, last non-direct click, any click or linear.
- Sessions. Shopify ends a session after 30 minutes of inactivity and counts sessions with its own cookies; GA4 uses its own session rules.
For channel attribution, Shopify’s own reports are often the quicker answer; our guide to Shopify marketing reports explains them. Related guides sit in our marketing and SEO hub.
Frequently asked questions
How do I connect Google Analytics 4 to Shopify? Create a GA4 property and web data stream in Google Analytics, install the Google & YouTube sales channel in Shopify, and connect the property there by following Google’s tag setup steps. Link Google Ads in Analytics if you advertise.
Do I need Google Merchant Center to use GA4 on Shopify? Shopify’s Help Center says you don’t have to connect Merchant Center to complete the GA4 tag setup in the Google & YouTube channel.
Why does GA4 show fewer purchases than Shopify? GA4 only sees visitors whose browsers load the tag and who gave consent where it is required. Shopify records every order. Duplicate or missing tags can also cause gaps.
Can I still use Universal Analytics on Shopify? Universal Analytics stopped processing new data on July 1, 2023, and access to its interface ended after July 1, 2024.