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 Google Analytics is an important step for any ecommerce business owner—just make sure you also learn how to put that data to work for your business. “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 your insights into actions that benefit your online store.
What is Google Analytics?
Google Analytics (GA) is a free website analytics platform. Beyond diving into top-level analytics like page views and sessions, GA helps you gain more nuanced insights into how users behave on your website. It shows detailed acquisition, behavior, and profitability metrics that help you make smarter, data-driven decisions about your website and business.
GA4 vs Universal analytics (GA3)
Universal Analytics, known as GA3, was Google’s previous platform. It revamped GA3 to Google Analytics 4 to make the free analytics tool even simpler to use and more accurate.
The biggest change from GA3 to GA4 is the data model. The old Universal Analytics used a session-based data model that collected data based on “hits.” Data was organized around page views, events, and transaction data, which meant that that information was less accurate.
Sessions started and ended when users arrived and 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 they were the same person using the same device.
GA4, however, collects more accurate data with the 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.
How does Google Analytics work?
Google Analytics works by collecting data from people who visit your website. It does this through tracking a JavaScript snippet that’s embedded into your website’s code. 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 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 vs. 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, website design, product development, pricing strategy, and copywriting.

Free Ebook: Ecommerce Analytics for Beginners
Find out which metrics are the key to establishing and growing your online business. This free guide is the perfect first step in learning about ecommerce analytics.
How to set up Google Analytics
- 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 free Google account. You can use an existing account or create a new one. 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 to track your website analytics. 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 savings 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.”

📈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. 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. Shopify makes this easy with the free Google & YouTube app.
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. It offers extra functionality beyond knowing 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, for example.
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.
Shopify stores automatically track certain 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
🔎 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 event-level data for up to two months by default. You may need to extend this if your average sales cycle spans longer than two months.
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 “Admin” and choose “Data retention.” You can opt to store event and user data for up to 14 months.

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 pageviews, 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 tags are firing and highlight any issues related to the setup.

How to use Google Analytics for ecommerce
- Identify profitable customer segments
- Build custom audiences for Google Ads
- Evaluate the customer journey
- Track marketing campaign effectiveness
- Create custom data explorations
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 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—perhaps you could add a “thank you” note to these high priority customers or offer free expedited shipping to incentivize their first order.
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 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, which work similarly to segments. You’ll use dimensions to narrow down who you want to target. An online store with a retail location in Chicago might filter users who live within a 15-mile radius of its store, for example.
- Predictive audiences, which 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 1,000 users to use this feature.
You can combine multiple conditions and timeframes 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 with them first becoming 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 shows the flow of people who:
- Start their session
- View a product
- Add an item to their cart
- Initiate checkout
- Make a 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 people 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 purchases derive from each channel) alongside more specific questions—like the average position of keywords that bring you organic traffic.
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=spring25
“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, create a custom data exploration. It arranges the most important metrics onto a custom dashboard. That makes it easy to find KPIs and share reports with stakeholders using data they’re most interested in.
💡You don’t need to create custom explorations each 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 any website owners to use. There’s no limit on how much data you can collect through the analytics platform. Even ecommerce sites that serve millions of users every day can use Google Analytics for free.
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 actions or events they make during their session.
Ecommerce businesses, in particular, get the most value by combining Google Analytics with Shopify Analytics. “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 for ecommerce FAQ
Is Google Analytics good for ecommerce?
Google Analytics is great for ecommerce because it shows how customers 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 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 just 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.