Google Analytics is a free website analytics platform that gives you detailed insights into how people behave when they visit your site.
Learning how to set up a website analytics tool is an important step for any ecommerce business owner. With Google Analytics, you can spot points of friction on your website, identify top-performing pages, and figure out where your traffic is coming from.
The key is coupling that data collection with specific business goals.
“When we capture data, we often don’t do it with an intention of what we’re going to do after that data comes back,” says Neil Hoyne, chief strategist at Google.
Read on to get the rundown on how to use Google Analytics for ecommerce. This comprehensive guide covers everything you need to set up and optimize your use of Google Analytics. Plus, we’ll dive deeper into how to turn customer insights into actions that benefit your online store.
What is Google Analytics?
Google Analytics (GA) is a free website analytics platform. It shows detailed marketing, acquisition, shopping, and revenue metrics that can help you make smarter, data-driven decisions about your website and business.
Beyond diving into top-level analytics like page views and sessions, GA helps you gain more nuanced, valuable insights into how users behave on your website. It might show that pages with videos have a lower bounce rate, or that visitors from TikTok have a higher conversion rate. You can use this to inform your strategy going forward—by incorporating more videos and prioritizing TikTok as a marketing channel.
GA4 vs. Universal Analytics (GA3)
Universal Analytics, known as GA3, was Google’s previous platform. The company revamped GA3 to Google Analytics 4 (GA4) to make the analytics tool more accurate and even simpler to use.
The biggest change from GA3 to GA4 is the data model. Universal Analytics used a session-based data model that collected data based on “hits.” Data was organized around page views, events, and transaction data.
Sessions started when users arrived, and ended when they exited your website, or after 30 minutes of inactivity. If a user left your site and returned later, GA3 would treat this as a new session—even if it was the same person using the same device.
GA4 collects more accurate data with an event-based model. Every interaction that a user has on your website is classified as an “event”—whether that’s loading a page, clicking a link, or viewing a video. Each event can have multiple parameters that offer additional context about the interaction, such as the page URL or button name.
In more practical terms: If a user clicks on a product and later completes a purchase, GA4 will treat each action as separate events tied to the same user ID with no session cutoff.
This shift matters for Google Analytics ecommerce tracking, because customers rarely shop on a single channel. They might discover your brand on TikTok, sign up for an email newsletter, then enter your URL in their browser to pick up a shopping cart they abandoned. GA4’s unified data model links these activities to show the continuous journey, rather than fragmented sessions.
How does Google Analytics work?
Google Analytics works by collecting data from people who visit your website. It does this by tracking a JavaScript snippet—a piece of code that collects user behavior data—that’s embedded into your website. This snippet passes this data back to Google Analytics to show your website analytics in one reporting dashboard.
Key components of Google Analytics include:
- Accounts. You’ll need at least one account to use Google Analytics, but you can configure different user logins. For example, you might have your business’s main Google account as the primary account, but each person on your marketing team can access the account with their own Google login.
- Properties. A property is an app or website that you want to collect analytics about. Every account can add up to 2,000 properties.
- Data streams. Each property can have up to 50 data streams that allow data to pass through from your website or mobile app to Google Analytics. The easiest way to create these is through the Google & YouTube app for Shopify.
- Events. Events measure unique user interactions that take place on your website, such as clicking a link, adding a product to an online cart, and completing checkout.
- Reports. Google Analytics divides its data into four reporting categories: acquisition, engagement, monetization, and retention. You can also see real-time reports that show how people are interacting with your website in the present moment.
Why you need Google Analytics to grow your ecommerce store
Since Google Analytics shares insight into how website visitors behave when they interact with your online store, this helps you answer questions like:
- What are the most-visited products and pages on your ecommerce site?
- On average, how much time are people spending on a particular page?
- Which pages on your website drive the most revenue for your business?
- How valuable is traffic from search engines versus social media ads?
- Which marketing campaigns or channels are bringing in low-quality traffic (i.e., visitors who leave without taking further action)?
- How many of your visitors are new versus returning?
- What percentage of visitors add a product to their cart, and what percentage of those people actually complete the checkout?
- What are the most popular devices your website is viewed on?
The answers to these questions can be actioned in every part of your business, from your marketing strategy and website design to product development, pricing strategy, and copywriting.
How to set up GA4 ecommerce tracking
If you’re using Google Analytics for the first time, here’s how to configure your account.
- Sign up for Google Analytics
- Set up an account and add your first property
- Configure a data stream
- Set up conversion events
- Configure data retention settings
- Test and validate your Google Analytics data
1. Sign up for Google Analytics
To get started with Google Analytics, you’ll first need a Google account. You can use an existing account or create a new one for free. If you’re using GA for your business, it’s best to connect it to your business email address.
2. Set up an account and add your first property
If you’re starting from scratch, once you’ve signed in to Google Analytics you’ll be prompted to create an account. This will set up a new profile—most people use their name or business name. Click “Next” to add the first property to your account.
If you’re not starting from scratch and already have a Google Analytics account, you can create a new property by selecting “Admin,” then “+Create Property” under the “Property” column.
On the next screen, enter a name, currency, and reporting time zone for your new property. A user visit will be reported in whichever time zone you select, even if it’s different from the user’s time zone. Reporting time zones update for Daylight Saving Time automatically.
You can also select your industry category and business size to get tailored recommendations from Google Analytics. If you’re selling coffee online, for example, choose “Food & Drink.”
📈Tip: You can track multiple properties under the same Google Analytics account. Say you want to track your online store, mobile app, and blog—you can do so by creating additional properties under the same account for each platform.
3. Configure a data stream
Google Analytics uses data streams to automatically collect ecommerce data from your website. This is the mechanism that translates customer actions (e.g., add to cart, checkout) into GA4-readable events. If you’re using Shopify, the Google & YouTube app manages this automatically.
Each property can have up to 50 data streams. For example, if you had a mobile app and ecommerce store, you could set up two data streams for Google Analytics to collect data from.
Google will create a snippet of code to add to your website’s <head> tag.
If you do not yet have the Google & YouTube app installed, go to your “Online Store Preferences” and select “Update account” in the Google Analytics module. It will then prompt you to install the Google & YouTube app, where you’ll click “Connect your Google Account.” Select your Google Analytics 4 property from the drop down menu, and connect your property.
If you already have the app installed, go into the app and select the “Optimize Your Business with Google Analytics” home card, select your Google Analytics 4 property, and connect your property.
4. Set up conversion events
Google Analytics lets you track behaviors that happen on your website, known as events, to generate more useful reports. Beyond learning how many people visit your website, you can see which products are most frequently added to a cart or how often people log into their account.
Google has a list of recommended events for each type of website. Some events are applicable to all websites, such as:
- Ad_impression
- Generate_lead
- Login
- Purchase
- Refund
- Search
- Share
- Sign_up
Retail and ecommerce businesses are advised to set up more Google Analytics events that track when customers complete tasks specific to ecommerce. For example, it’s useful to set up events that track when customers enter their payment information, add or remove a product from their cart, and view a promotion.
In event reporting, GA4 breaks metrics down into two categories:
- Event-scoped metrics. The action itself, such as total revenue or completed transactions.
- Item-scoped metrics. The products a user is interacting with, such as items viewed or added to cart.
This distinction influences how you’ll interpret cart, product, and sales performance reports.
For example, the event-scoped metric (total revenue) shows the total amount users spent on your website, including taxes and shipping. The item-scoped metric (product revenue) includes only the product price.
Comparing the two can show the percentage of revenue that actually comes from non-product-related fees. If you use the event-scoped metric to judge product performance, you’ll accidentally credit that product with the tax and shipping costs of the entire order, making it look more profitable than it is.
Shopify stores automatically track specific ecommerce events to pass data. As soon as you install the Google & YouTube app, your Shopify store will track the following events in Google Analytics 4:
- Page view
- Search
- View item
- Add to cart
- Begin checkout
- Add payment information
- Purchase events
🔎 Looking for more specific event tracking? Create the code through Google Analytics and install it on your website, either through Google Tag Manager or by adding events to your website’s JavaScript. Both options are quite complex, so consider getting help from a website developer and backing up your website before making any code changes.
5. Configure data retention settings
Google Analytics 4 will retain user-level data for up to 14 months. All other ecommerce event data is stored for two months by default, but you may need to extend this if your average sales cycle is longer.
Say, for example, that you’re selling high-end furniture. The average sales cycle might span several weeks—customers spend this time measuring their space, comparing options, and choosing materials. Any detailed data about individual user actions (such as which products were viewed, added to cart, or abandoned) that happened earlier in the purchase journey will be lost after the two-month default retention period is up.
If you need to extend this default data retention setting, head to “Admin4,” find “Data collection and modification” and choose “Data retention.” You can opt to store event and user data for up to 14 months on GA4’s free plan.
6. Test and validate your Google Analytics data
Google Analytics relies on accurate code integrations to collect data. Just one incorrect character can wreak havoc on data accuracy, so spend a few minutes testing and validating your setup.
The “Realtime overview” report is the simplest way to do this. You should see your own activity, such as page views, events, and other interactions, in real time as you navigate through the site.
You can also use the Google Tag Assistant plug-in to confirm that your GA4 account is set up correctly. The Chrome extension will show which ecommerce tags are firing and highlight any issues related to the setup.
Common GA4 setup issues and how to fix them
Here are common issues you might run into when installing GA4, with possible causes and solutions:
| GA setup issue | Possible causes | Solution |
|---|---|---|
| Tags not firing |
|
|
| Duplicate transactions |
|
|
| Data discrepancies |
|
|
How to use Google Analytics for ecommerce
Collecting data is the first part of the puzzle—the other is putting it to work. Here’s how to use what you find inside Google Analytics to make smarter business decisions.
Identify profitable customer segments
Customer segmentation divides your audience into groups based on similar qualities, traits, or behaviors they share. It lets you deliver more personalized marketing campaigns on the channel they’re most likely to use, test different pricing options, and define what your VIP customers look like, so you can find more of them.
Google Analytics has its own customer segmentation tools built into the ecommerce analytics platform. Choose from a prebuilt comparison, such as traffic source (people who’ve started their session through a direct, organic, paid, email, or referral source) or device (mobile, desktop, or tablet).
Alternatively, you can build a custom event using the following GA4 dimensions:
- Ad frequency (how many times they’ve viewed your ad)
- Age or gender of the user
- Geography (city, country, or region where they’ve accessed your site)
- Individual URL they’ve viewed on your site
- The landing page their session started on
- Events they’ve triggered (e.g., completed a purchase)
- The browser or device they’re using
- Length of user lifetime, either from their first session or visit date
Once you’ve created the segment, you can slice and dice your data to compare how each group behaves. For example, you could see how the conversion rate differs depending on the landing page each segment first visited your website from.
You could also compare which URLs your VIP customers (categorized with the “audience name” exactly matches “Expert users” dimension) visited during their first purchase journey. This lets you spot new visitors who are showing similar traits and act accordingly—perhaps sending a thank you note to these high-priority customers, or offering free expedited shipping to incentivize their first order.
“One of the biggest things that we’re kind of getting into now is targeting our customers now that we know who’s buying, what time they are buying,” says Earl Cooper, co-founder of Eastside Golf, in a Shopify Masters interview. “All that information, all that data just becomes informative to where it allows you to scale your company.”
Build custom audiences for Google Ads
Google has its own advertising platform, known as Google Ads, that helps retailers reach their target audience through sponsored results in Google search results, YouTube videos, and sites within the Google Display Network.
To run these Google Ads, you’ll need to create audience lists. But this doesn’t have to be a manual or time-consuming process. By linking your Google Ads account with your GA4 account, you can retarget people who’ve completed an action on your website through a Google Shopping campaign.
To create these audiences in Google Analytics, go to “Admin,” choose “Data Display,” and select “Audiences,” then create a new audience.
There are two ways to do this:
- Custom audiences. These work similarly to segments. You’ll use dimensions to narrow down who you want to target. For example, an online store with a retail location in Chicago might filter users who live within a 15-mile radius of its store.
- Predictive audiences. These use historical data and artificial intelligence (AI) to anticipate which users will fit your audience criteria. For example, you could build a predictive audience of users who are likely to make a purchase within the next seven days. (You’ll need at least 2,000 users to use this feature.)
You can combine multiple conditions and time frames to create more complex Google Shopping audience lists. For example, you can create an audience of users who added items to the cart and visited the checkout page—but did not complete the purchase—within the past seven days.
Evaluate the customer journey
A customer journey map shows the path a typical customer takes toward a purchase. It starts when they first become aware of your business and concludes when they become loyal customers or make their final purchase.
Google Analytics helps you build customer journey maps with the “Purchase journey” report. It surfaces ecommerce conversion rates at each funnel step, when customers:
- Start their session
- View a product
- Add an item to their cart
- Initiate checkout
- Make a purchase
GA4 calculates stage conversion as a percentage of users who move from one event to the next. If 1,000 website visitors viewed a product page and 300 of them added an item to their cart, GA4 would count the conversion rate as 30%.
There are two models you can use for this ecommerce conversion rate report in Google Analytics:
- Closed funnel. Users must check the first step before continuing. For example, if they go directly to a cart page from a bookmarked link, they’re excluded from the funnel.
- Open funnel. Users can enter at any step. Using the same example: that user would show up in the third step (add to cart) even though they never triggered step two (viewing a product).
Use your report to monitor step-by-step conversion rates. It helps identify precise drop-off points in the funnel which make for prime conversion rate optimization (CRO) testing opportunities:
| High drop-off | Potential CRO tests |
|---|---|
| Session start > View product |
|
| View product > Add to cart |
|
| Add to cart > Begin checkout |
|
| Begin checkout > Purchase |
|
Instead of viewing this report within the context of everyone who visits your website, narrow down your audience size by the device or browser they’ve used, the country they’re browsing from, or the language they speak. This can highlight points of friction that are specific to each segment.
You might find that people who visit your website on mobile, for example, drop off at the “initiate checkout” stage. Do a run-through of the checkout process on your own device. Is it mobile-friendly? Are buttons big enough for mobile users to use? Can you accept mobile payment methods such as Apple Pay? These small tweaks can make a huge difference to how many users pass through your customer journey.
Track marketing campaign effectiveness
Do you know which marketing channels are most effective at acquiring customers? Google Analytics can help you find the answer. You can uncover top-level marketing analytics (like how many sessions, page views, and unique purchases come from each channel) alongside more specific questions—like how the keywords that bring you organic traffic rank.
Sometimes Google can’t correctly attribute the referral source of a new website session. This can happen if a website visitor has blocked cookie tracking or is using a browser with built-in privacy features.
UTM parameters solve this problem and make your Google Analytics marketing reports more accurate. They’re unique snippets of information added at the end of a link to describe the context it’s in:
- utm_source describes the main website or source, such as “facebook”
- utm_medium describes the marketing activity, such as “ppc” or “affiliate”
- utm_campaign describes the overall marketing campaign, such as “spring25”
- utm_term describes the keyword used in a Google Ads campaign
If you wanted to track how people engage with your website after clicking a Facebook Ads spring campaign, for example, here’s what the UTM parameters would look like for any link in that campaign:
www.yourwebsite.com/?utm_source=facebook&utm_medium=ads&utm_campaign=spring26
“You need to be mindful about what’s leading you to slightly better people [customers who stick with you longer and spend more money], and put a little bit more emphasis there and a little less emphasis on those people we know aren’t going to come back,” Neil Hoyne says.
Create custom data explorations
Google Analytics offers prebuilt reporting dashboards that show popular metrics. However, what matters to one business might not be a high priority for another.
For instance, a subscription-based business might be primarily concerned with churn rate and free trial conversions. Meanwhile an ecommerce website that sells luxury clothing could track purchase intent with events such as “add to cart” and “product views.”
Instead of configuring these dashboards each time you sign into Google Analytics, you can create a custom data exploration. It arranges the most important ecommerce metrics onto a custom dashboard. That makes it easy to find key performance indicators (KPIs) and share reports with stakeholders using data they’re most interested in.
💡Tip: You don’t need to create custom explorations every time you want an answer to a specific question. That’s what Google Analytics Intelligence is for. If you want to compare revenue from users who visit through organic search and paid search, for example, type that into the search bar for an immediate answer.
How much does Google Analytics cost?
Google Analytics is free and available for all website owners to use and create unlimited reports from. Even ecommerce sites that serve millions of users every day can use Google Analytics for free. However, there is a sampling limit of 10 million events per query and a maximum data retention period of 14 months.
The paid version, Google Analytics 360, starts at around $50,000 per year. This offers higher sampling limits, longer data retention, more custom dimensions, and more regularly updated data.
Steer your growth in the right direction with Google Analytics
Google Analytics is an invaluable tool for any website owner. It offers insight into not just how many people visit your site, but also how they engage with it—including any ecommerce actions or events they make during their session.
Ecommerce businesses in particular get the most value by combining Google Analytics with Shopify Analytics. It helps overcome GA4’s shortfalls—notably inaccurate data from users who’ve opted out from cookie tracking.
“I find Google Analytics is great for modeling visitor behaviors, whereas Shopify Reports is what I use for analyzing our sell-through rates and merchandising mix of our products,” says Daniel Patricio, owner of Bull & Cleaver. “Together, the two help us optimize our website and our product mix on it.”
Read more
- How To Make Your First Ecommerce Sale—Fast (Tutorial 2024)
- The 13 Best Dropshipping Suppliers in 2024
- A 14-Point Ecommerce Checklist to Launch Your Shopify Store
- How To Find a Product to Sell: 16 Proven Methods
- 29 Best Affiliate Marketing Programs for Beginners
- 24 Free Shopify Apps to Help You Build, Manage, and Grow Your Store
- How To Source Products To Sell Online
- Conversion Rate Optimization- How to Get Started with CRO
- 19 Growth and CRO Experts on Increasing Revenue Without Increasing Traffic
- 4 Checkout Conversion Killers That Drive Your Buyers Away
Google Analytics ecommerce FAQ
Is Google Analytics good for ecommerce?
Google Analytics is a great way to track ecommerce performance, because it shows how users interact with your website. You can track not just how many people visit your online store, but also how they discovered your site, which products they buy, and what content they viewed during the customer journey.
How does Google Analytics track ecommerce conversion rates?
Google Analytics tracks ecommerce conversion rates by dividing the total number of sessions by the number of conversions that happen on your website. Conversions doesn’t have to mean complete purchases—you can class conversions as any event, such as completing a form, creating an account, or adding a product to their online cart.
How does Shopify work with Google Analytics?
With the Google & YouTube app for Shopify, any data collected from your online store—including events—feeds back to your Google Analytics account. You can also sync your product catalog and run Google Ads campaigns with the app.
Why do Google Analytics numbers differ from Shopify admin?
There are several reasons why GA4 data might differ from Shopify Analytics reports:
- Users don’t accept cookie tracking which Google Analytics relies on.
- Visitors use browser extensions to block Google Analytics code.
- Shopify and GA4 might have different reporting time zones.
What are GA4’s limitations for ecommerce tracking?
The biggest limitations in using GA4 for ecommerce analytics are:
- Maximum 14-month data retention period
- Inaccurate data if visitors opt out of cookie tracking or use browser blockers
- Time delay of 24 to 48 hours for data to appear inside Google Analytics





