Shopify Google Analytics: Complete GA4 Setup Guide

Connecting Google Analytics to your Shopify store is one of the highest-leverage moves you can make as an e-commerce operator. Without it, you're guessing at traffic quality, at which products actually convert, and where customers drop off. This guide, NextSky, walks you through every step of adding GA4 to Shopify, from account creation to ecommerce tracking, shows you how to put that data to work.

What Is Google Analytics and hy Does It Matter for Shopify?

Google Analytics 4 (GA4) is a free analytics tool that shows how visitors discover and interact with your Shopify store. It helps you identify top-performing marketing channels, understand customer behaviour, and track the path to purchase.

While Shopify Analytics focuses on sales data, GA4 provides deeper marketing and customer insights. Together, they give you a complete picture of store performance.

Unlike Universal Analytics (GA3), GA4 uses an event-based model to track actions such as page views, add-to-cart events, and purchases, delivering more accurate e-commerce reporting across devices and sessions.

Step-by-Step: How to Add Google Analytics to Shopify

Step 1: Create a Google account and Google Analytics account

You'll need a Google account to use Google Analytics. If you already have Gmail, Google Ads, or Google Search Console, you can use the same account. Then, go to analytics.google.com , click Start measuring, and create an account using your business name. This top-level account can hold multiple GA4 properties if you manage more than one website.

Tip: Use your business Google Workspace email rather than a personal Gmail account. This keeps access management clean and makes it easier to add team members or transfer ownership in the future.

Step 2: Create a Google Analytics 4 property

After creating your account, you'll be prompted to add a property, GA4's term for the website or app you want to track.

  1. Enter a property name (e.g., "My Shopify Store").
  2. Set your reporting time zone to match your Shopify store's time zone. Mismatched zones are one of the most common causes of data discrepancies between GA4 and Shopify reports.
  3. Choose your currency to match your store's selling currency.
  4. Click Next, answer the optional business category and size questions, then click Create.

After creating the property, GA4 will ask you to set up a data stream. Select Web, enter your store's URL, and give the stream a name. GA4 will generate a Measurement ID (formatted as G-XXXXXXXXXX). Copy this — you'll need it in the next step.

Step 3: Add Google Analytics to Shopify via the Google & YouTube App

This is the recommended installation method for all Shopify stores. The Google & YouTube app (available for free in the Shopify App Store) implements tags in a way that's compatible with Shopify's checkout architecture, including Checkout Extensibility, Shopify's updated checkout framework that replaced the older checkout.liquid approach.

Why the Google and YouTube app is the right choice

Shopify's checkout is sandboxed, so custom JavaScript isn't supported. The Google & YouTube app automatically tracks ecommerce events across product, cart, checkout, and Thank You/Order Status pages. Legacy tracking methods like script tags, checkout.liquid, and Additional Scripts have been retired, and stores that haven't upgraded since August 2025 may be losing conversion data. 

Installation steps

  1. From your Shopify admin sidebar, go to AppsApp Store.
  2. Search for Google & YouTube and install it.
  3. Open the app and click Connect your Google account. Sign in with the account that has admin access to your GA4 property.
  4. Under the Google Analytics section, select the GA4 property you created in Step 2.
  5. Click Connect. The app will automatically load the Google tag across your storefront and checkout.

Note: Your store must be password-protected free (i.e., published and accessible to the public) before GA4 can track events. If your store is still in development mode with password protection enabled, tracking will not work.

Step 4: Configure a data stream and verify your measurement ID

After connecting through the app, it's worth confirming the correct Measurement ID is active. Inside the Google & YouTube app, navigate to Settings and verify that the GA4 property and Measurement ID shown match what you created in Step 2. If you see a different ID or no ID at all, disconnect and reconnect the Google account to re-trigger the property selection flow.

Step 5: Link Google Analytics to Google Ads (Optional but Recommended)

If you're running Google Ads campaigns, linking your GA4 property to your Ads account unlocks two significant capabilities:

  • Audience sharing: Export GA4 audience segments (e.g., users who added to cart but didn't purchase) directly into Google Ads for retargeting.
  • Conversion import: Use GA4 purchase events as conversion actions in your Ads campaigns, giving Google's bidding algorithms better data.

To link the accounts: in GA4, go to AdminProduct LinksGoogle Ads LinksLink. Select your Ads account and confirm. 

Once the Google & YouTube app is connected, the following events start flowing into GA4 without any additional configuration:

Event Name

What It Captures

page_view

Every page a visitor loads on your store

search

On-site searches customers run

view_item

A product detail page view

add_to_cart

A product added to the shopping cart

begin_checkout

A customer initiating the checkout process

add_payment_info

Payment details entered successfully

purchase

A completed order

These seven events cover the full purchase funnel and provide enough data for most Shopify stores. Once your core tracking is working, you can add advanced events like view_item_list, remove_from_cart, and select_promotion using Google Tag Manager or custom pixels.

Step 6: Configure data retention settings

GA4's default data retention period for event-level data is two months. For most ecommerce decisions, that's too short, seasonal comparisons and longer purchase cycles require more history.

Extend this to 14 months (the maximum on the free plan) immediately after setup:

  1. In GA4, go to AdminData Collection and ModificationData Retention.
  2. Change "Event data retention" to 14 months.
  3. Toggle on Reset user data on new activity if you want session activity to refresh the retention clock for returning visitors.
  4. Click Save.

This is a one-time setting that's easy to miss and expensive to neglect — you can't retroactively recover data you didn't retain.

Step 7: Verify your setup

Don't assume the integration is working — confirm it. Two tools make this straightforward:

  • GA4 Realtime Report: Open Reports → Realtime, then browse your Shopify store in another tab. Within a few seconds, you should see your own page views, events, and approximate location. If nothing appears after two minutes, your tracking is likely misconfigured.
  • Google Tag Assistant: Use the Chrome extension to start a debug session on your store. It shows every Google tag firing, verifies your GA4 Measurement ID, and helps confirm the purchase event fires correctly on the Thank You page, the most common tracking failure point.

Common GA4 setup issues and how to fix them

Even with the Google and YouTube app, a few problems come up consistently in Shopify implementations:

Tags not firing

  • Likely cause: The app is installed but not fully connected, or the store still has password protection enabled.
  • Fix: Check the app's connection status and confirm your store is publicly accessible.

Duplicate purchase events

  • Likely cause: You have both the Google & YouTube app active and a manual GA4 tag embedded in your theme code or via a custom pixel — the purchase event fires twice.
  • Fix: Remove any manual GA4 tags. The app's implementation should be the only one running.

Data discrepancies between GA4 and Shopify

This is normal and expected to some degree. Three common reasons:

  • Cookie consent: Visitors who decline tracking cookies won't appear in GA4, but they'll still appear in Shopify's order data (which doesn't rely on browser cookies).
  • Time zones: If GA4 and Shopify are set to different time zones, day-over-day comparisons will be off by the time zone offset.
  • Bots and crawlers: GA4 filters out known bot traffic; Shopify may count some of it.

Shopify Analytics and GA4 will rarely match exactly. Use Shopify for revenue truth and GA4 for behavioural analysis.

How to use GA4 data to grow your Shopify store

Setting up tracking is the beginning, not the goal. Here's how to turn GA4 data into decisions:

Identify your best traffic sources

In GA4, go to Reports → Acquisition → Traffic Acquisition to see which channels drive visitors and, more importantly, purchases. High-traffic channels with few sales often mean wasted effort, while lower-traffic channels with strong conversion rates are usually worth investing in.

Extend data retention with Shopify analytics as your source of truth

GA4's 14-month retention cap is a real limitation for year-over-year analysis. The practical workaround: use Shopify Analytics for long-term revenue and order data (Shopify retains this indefinitely), and use GA4 for behavioural and funnel analysis within its retention window. Both tools have complementary strengths, running them together gives you a more complete picture than either offers alone.


Comments

Looking for Help?
Get support from our team

If you can't find the answer you're looking for, our support team is here to help.