How to Get Google Analytics on Shopify
Adding Google Analytics to your Shopify store is one of the most effective ways to understand how shoppers find and interact with your site. While Shopify has its own built-in analytics, connecting Google Analytics gives you far more detail about your audience, their behavior, and the true performance of your marketing efforts. This tutorial will walk you through exactly how to set up Google Analytics on Shopify, verify it's working correctly, and start gathering valuable e-commerce data.
Why Connect Google Analytics to Your Shopify Store?
You might be wondering, "Doesn't Shopify already give me analytics?" Yes, it does, offering great top-level information on sales, orders, and traffic sources. However, Google Analytics dives much deeper, helping you answer critical questions that Shopify's reporting can't.
Here's what you gain by adding Google Analytics 4:
- A Full View of the Customer Journey: Discover which marketing channels (like Google Ads, Facebook, email marketing, or organic search) are not just driving traffic, but are leading to actual sales. See the paths customers take from their first visit to their final purchase.
- In-Depth Audience Insights: Learn about your shoppers' demographics, interests, geographical locations, and the devices they use. This helps you create more targeted and effective marketing campaigns.
- Detailed On-Site Behavior Analysis: Pinpoint exactly where users are dropping off in your sales funnel. Identify your most popular products and weakest pages, see what people are searching for on your site, and understand user flow from page to page.
- Advanced E-commerce Tracking: Go beyond just tracking final sales. With GA4, you can monitor events like adding items to a cart, initiating the checkout process, and viewing specific product lists to get a complete picture of shopping behavior.
Essentially, Shopify tells you what happened, while Google Analytics helps you understand why it happened.
Step 1: Create a Google Analytics 4 Property
Before you can connect anything to Shopify, you need a place for the data to go. This means setting up a Google Analytics 4 property. If you already have one, you can skip to grabbing your Measurement ID. If you're new to GA4 or only have an old Universal Analytics property (with an ID starting with "UA-"), you'll need to create a new one.
Here's how to do it:
- Log into your Google Analytics account. If you don't have one, you can create one with your Google account.
- Click the Admin gear icon in the bottom-left corner.
- In the "Property" column, click the + Create Property button.
- Enter a name for your property (e.g., "My Shopify Store"). Select your reporting time zone and currency, then click Next.
- Provide your business information, such as industry and business size, and click Next.
- Choose your business objective (e.g., "Drive online sales") and click Create.
- You'll now be asked to set up a "data stream," which is the source of your data. Click on Web.
Setting Up Your Web Data Stream
This is where you'll get the critical piece of code needed for Shopify.
- Website URL: Enter your Shopify store's primary domain (e.g., yourstore.com). Don't include the
https://at the beginning. - Stream name: Give your stream a descriptive name, like "Shopify Website Stream."
- Ensure Enhanced measurement is turned on. It should be by default, and this automatically tracks important actions like page views, scrolls, and outbound clicks.
- Click Create stream.
After creating the stream, you'll see a panel with stream details. At the top right, you'll find your Measurement ID, which starts with "G-" followed by a string of letters and numbers. This is the ID you need. Copy it to your clipboard.
Step 2: Add Your Google Analytics ID to Shopify
Now for the easy part. Shopify has a built-in integration that makes connecting Google Analytics incredibly simple. This is the recommended method for 99% of store owners because it's safe and automatically installs tracking code across your entire site, including the checkout pages.
- Log in to your Shopify Admin.
- From the left-hand navigation menu, go to Online Store > Preferences.
- Scroll down to the Google Analytics section.
- You'll see a box labeled "Google Analytics account." Paste your Measurement ID (the G- code you just copied) into this box.
- Make sure you click the Save button at the top right of the page.
That's it! Shopify will now automatically add the Google Analytics tracking tag to every page of your store. This includes product pages, collection pages, and the entire checkout flow, providing you with a complete view of a customer's journey.
Step 3: Verify Your Setup in Google Analytics
Once you've saved your Measurement ID in Shopify, you need to make sure the connection is working. The easiest way to do this is by checking the "Realtime" report in GA4. Keep in mind that standard reports can take 24-48 hours to populate with data, but the Realtime report shows activity as it happens.
- In a new browser tab or on your phone, open your Shopify store's homepage. Click around to a few different pages, like a product page or a collection page.
- Go back to your Google Analytics account.
- In the left navigation menu, go to Reports > Realtime.
Within a minute or two, you should see at least one user appear in the "Users in last 30 minutes" card on the Realtime report. You can also see which pages are being viewed under the "Views by Page title" card. If you see activity, congratulations – your setup is successful!
What About Enhanced Ecommerce?
One of the best reasons to use GA4 with Shopify is for advanced e-commerce tracking. Enhanced Ecommerce allows you to see more granular data, such as:
view_item: A user views a specific product page.add_to_cart: A user adds an item to their cart.begin_checkout: A user starts the checkout process.purchase: A user completes a purchase.
The good news is that when you use Shopify's native integration (by pasting the Measurement ID in Preferences), Shopify automatically sends these e-commerce events to Google Analytics for you. There are no extra steps required. You can see these events populating in your GA4 reports under Engagement > Events after the first 24-48 hours.
Common Mistakes to Avoid
The process is straightforward, but a few common missteps can lead to inaccurate data. Here's what to watch out for:
Mistake 1: Double Tracking
This is the most frequent issue. It happens when you have two instances of the Google Analytics tracking code on your site. For example, if you paste the G- ID into the Shopify Preferences section and you manually add the tracking code to your theme's theme.liquid file. This causes every page view to be counted twice, which will completely skew your data.
The Fix: Use only one method. The Shopify native integration is the best option for almost everyone. If you have any reason to edit your theme files, make sure you first remove the ID from the Preferences section.
Mistake 2: Using an Old Universal Analytics ID
Google officially replaced Universal Analytics (UA) with Google Analytics 4. Old UA tracking IDs start with "UA-". The native Shopify integration is designed for a new GA4 Measurement ID, which starts with "G-". If you only have a "UA-" code, your tracking might not work correctly or gather the right data.
The Fix: Follow the steps outlined in this guide to create a new GA4 property and get a "G-" Measurement ID.
Mistake 3: Panicking When Data Doesn't Appear Immediately
Except for the Realtime report, it takes Google Analytics 24 to 48 hours to process and display data in its standard reports. It's perfectly normal to see no data in reports like "Traffic acquisition" on day one.
The Fix: Be patient! Use the Realtime report to confirm the initial setup, then give your standard reports up to two days to start populating.
Final Thoughts
Connecting Google Analytics to your Shopify store is a fundamental step toward making smarter, data-driven decisions. By following the simple steps above, you unlock a wealth of information about your customers' behaviors, allowing you to optimize your marketing spend, improve your website's user experience, and ultimately drive more sales.
Once your Shopify and Google Analytics data starts coming in, the next step is turning that raw data into clear, actionable insights. That's where we wanted to make things easier. At Graphed, you can connect both your Shopify and Google Analytics accounts in seconds and then use simple, plain English to build real-time dashboards. Instead of trying to find the right report in GA4, you can just ask, "Show me a chart of Shopify revenue by marketing channel from Google Analytics for the last 30 days," and instantly get the visualization you need.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?