Your Favorite eCom Newsletter  (Once you know it exists) Your Favorite eCom Newsletter (Once you know it exists)
Take a look

3 Simple Steps to Connect Google Analytics 4 (GA4) to Shopify

By Irene LeJune 1, 20254 min read
3 Simple Steps to Connect Google Analytics 4 (GA4) to Shopify

Google Analytics 4 (GA4) is essential for understanding your Shopify analytics tracking—but as of 2025, Shopify has migrated GA4 tracking to a new feature called Customer Events. That means you no longer need to manually add your GA4 tag to the theme.

This guide will walk you through the updated method of connecting GA4 to Shopify using Customer Events and explain what to do if you haven't set up a GA4 property yet.

How to add Google Analytics to Shopify?

Step 1: Get Your GA4 Measurement ID

Need to create a GA4 property first? Here’s an easy guide to set it up:

1. Log in to Google Analytics

Open analytics.google.com and sign in with the Google account you use for your business.

2. Create a New Property

  • In the bottom-left corner, click Admin.
  • Under the Account column, select your account (or click Create Account).
    Under the Property column, click Create Property.
  • Enter a name (like “MyShopifyStore GA4”), choose your reporting time zone and currency, then click Next → Create.

3. Set Up a Web Data Stream

  • After creating the property, select Web as the platform.
  • Enter your store’s URL (e.g., https://www.yourstore.com) and give it a name (“Shopify GA4 Stream”).
  • Click Create stream.

4. Copy Your Measurement ID

  • On the Web stream details page, copy the Measurement ID (it looks like G-XXXXXXXXXX).
  • Keep this handy—you’ll paste it into Shopify in Step 2.

If you already have a GA4 property, here are steps to find your measurement ID:

Large preview
  1. Go to analytics.google.com and log in
  2. Click your GA4 property
  3. In the left sidebar, click Admin
  4. Under the Property column, click Data Streams
  5. Select your Web data stream
  6. Copy your Measurement ID (it starts with G-XXXXXXX)

Step 2: Add GA4 via Customer Events in Shopify

Large preview
  1. In Shopify Admin, go to Settings > Customer Events
  2. Click Google Analytics 4 under the “Custom Pixels” section
Large preview
  1. Paste your Measurement ID
  2. Save the changes

Shopify automatically handles most event tracking, such as page views, add-to-carts, and purchases.

Step 3: Verify Your Setup

  1. Use GA4’s Realtime Report
    • In GA4, click Realtime.
    • Visit your Shopify store in a new tab and navigate pages. You should see your activity appear instantly.
  2. Test an Order
    • Place a low-value test order on your store.
    • In GA4’s Engagement > Events report, look for the purchase event and verify the revenue matches your test order.

Best Practices for Having Shopify Google Analytics 

1. Avoid Double Tracking

If you switch from the native Shopify integration to Google Tag Manager (or vice versa), make sure to remove the old script or Measurement ID to avoid duplicate data.

How to check: In GA4’s DebugView, see if each action (like “page_view”) appears only once per page load. If you see duplicates, check your store theme and GTM setup.

2. Data Delay Is Normal

GA4’s standard reports take up to 48 hours to show data. Only Realtime and DebugView update immediately. Don’t panic if yesterday’s orders aren’t showing just yet.

3. Complement GA4 with Ecommerce-Focused Tools

While GA4 gives you deep behavioral insights, it doesn't show real profit after expenses, ad costs, or shipping. For a complete financial picture of your Shopify store, many merchants pair GA4 with best Shopify apps for analytics like TrueProfit to track real-time profit, cost of goods sold, and net profit margins. It helps bridge the gap between what users do and how much each action is worth.

TrueProfit Shopify Profit Tracker

Shopify Google Analytics FAQs

Does Google Analytics work with Shopify?

Yes, Google Analytics works with Shopify. You can integrate Google Analytics 4 (GA4) into your Shopify store to track visitor behavior, conversions, traffic sources, and more.

How do I add a Google Analytics code to my Shopify website?

To add Google Analytics to Shopify:

  1. Create a GA4 property in your Google Analytics account.
  2. Copy the Measurement ID.

In Shopify, go to Online Store > Preferences and paste the ID under Google Analytics.

Save your changes. Use Google Tag Manager for more advanced tracking.

Why does Google Analytics not match Shopify?

Google Analytics and Shopify often show different numbers due to:

  • Different tracking methods (JavaScript vs server-side)
  • Ad blockers or browser settings
  • Delayed GA4 reporting
  • Multi-device or session tracking inconsistencies

Use both tools together to get a full picture of traffic and sales.

Does Shopify have built-in Analytics?

Yes, Shopify offers built-in analytics, including sales, product, and traffic reports. However, the level of detail depends on your Shopify plan. For deeper insights, most merchants also use Google Analytics and TrueProfit.

How do I index my Shopify store on Google?

To index your Shopify store on Google:

  1. Submit your sitemap to Google Search Console.
  2. Use a clean, SEO-optimized theme.
  3. Add meta titles and descriptions to products and pages.
  4. Make sure your store is set to visible to search engines under Preferences.

How much does Google Analytics cost?

Google Analytics is free for most users. The premium version, GA4 360, is available for enterprises and large businesses starting at around $50,000/year.

How to optimize SEO on Shopify?

To optimize Shopify SEO:

  • Use descriptive meta titles and alt text
  • Create keyword-rich product descriptions
  • Add a blog to target informational keywords
  • Submit your sitemap to Google

How do I set up Google Analytics for my website?

  1. Sign up at analytics.google.com.
  2. Create a GA4 property.
  3. Install the tracking code or use a plugin/integration (e.g., Shopify or WordPress).
  4. Verify data is flowing via Realtime reports.

How do I connect my Shopify to Google?

You can connect Shopify to Google by:

  1. Installing Google Analytics (GA4)
  2. Connecting Google Search Console
  3. Syncing products to Google Merchant Center via the Google & YouTube app
  4. Optionally, setting up Google Ads conversion tracking

Does Shopify integrate with Google?

Yes, Shopify integrates with several Google services, including:

  • Google Analytics
  • Google Search Console
  • Google Merchant Center
  • Google Ads

How to use Google Analytics for ecommerce?

With GA4, enable Enhanced Measurement and eCommerce tracking to analyze:

  • Product views and add-to-carts
  • Checkout steps and drop-off
  • Revenue by source
  • Customer journeys

For deeper financial tracking, tools like TrueProfit help monitor real-time profit and costs.

avatar
Irene Le

Content Manager at TrueProfit & eCommerce Marketing Specialist

Irene Le is the Content Manager at TrueProfit, specializing in crafting insightful, data-driven content to help eCommerce merchants scale profitably. With over 5 years of experience in content creation and growth strategy for the eCommerce industry, she is dedicated to producing high-value, actionable content that empowers merchants to make informed financial decisions.