Analytics & Data
Google Analytics for E-Commerce: The Complete Setup Guide
Learn how to set up Google Analytics 4 for your online store, configure e-commerce tracking, create custom reports, and use data to make smarter business decisions.
Why Google Analytics Matters for E-Commerce
Google Analytics is the foundation of data-driven e-commerce. It tells you where your visitors come from, what they do on your store, and whether they convert into paying customers. Without it, you are flying blind, spending money on ads without knowing what works.
Google Analytics 4 (GA4) is the current version, and it is built around event-based tracking rather than the old pageview model. This makes it significantly more powerful for understanding customer behavior across devices and sessions.
Setting Up GA4 for Your Store
Step 1: Create a GA4 Property
- Go to analytics.google.com and sign in with your Google account
- Click Admin (gear icon) in the bottom left
- Click Create Property
- Enter your store name and select your time zone and currency
- Choose your business size and objectives
- Select Web as your platform
- Enter your store URL and name your data stream
Google will generate a Measurement ID (starts with G-). This is the ID you need to install on your store.
Step 2: Install the Tracking Code
The GA4 tracking snippet goes in the head section of every page on your store. Most e-commerce platforms have a built-in field for your GA4 Measurement ID. If you are on a managed platform like Strive Commerce, analytics integration is handled automatically.
For manual installation, add this script to your site head:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Replace G-XXXXXXXXXX with your actual Measurement ID.
Step 3: Enable E-Commerce Events
GA4 supports standard e-commerce events that give you detailed purchase funnel data:
- view_item: When someone views a product page
- add_to_cart: When someone adds a product to their cart
- begin_checkout: When someone starts the checkout process
- purchase: When a transaction completes
These events need to be fired from your store code with the correct parameters (item name, price, quantity, transaction ID). Platforms like Strive Commerce fire these events automatically.
Key Reports for E-Commerce
Acquisition Report
This shows where your traffic comes from:
- Organic Search: People who found you through Google
- Paid Search: Google Ads traffic
- Social: Facebook, TikTok, Instagram, etc.
- Direct: People who typed your URL directly
- Referral: Traffic from other websites linking to you
Use this report to understand which channels drive the most valuable traffic, not just the most volume.
Engagement Report
This reveals what visitors do on your store:
- Which pages get the most views
- How long people spend on each page
- Which events fire most frequently
- What percentage of sessions include key actions
Look for pages with high traffic but low engagement. These are opportunities for optimization.
Monetization Report
This is the money report. It shows:
- Total revenue over time
- Revenue by product
- Average purchase value
- E-commerce conversion rate
- Purchase funnel visualization
The purchase funnel is especially valuable. It shows you where people drop off between viewing a product and completing a purchase.
User Explorer
This lets you examine individual user journeys. You can see exactly what pages someone visited, what actions they took, and whether they converted. This qualitative data is invaluable for understanding real customer behavior.
Setting Up Conversions
Conversions (called Key Events in GA4) track the actions that matter most to your business:
- Go to Admin > Events
- Find the purchase event
- Toggle it as a Key Event
You should also mark add_to_cart and begin_checkout as key events. This lets you see conversion rates at each stage of your funnel.
Custom Audiences
GA4 lets you create audiences based on behavior:
- Cart abandoners: Added to cart but did not purchase in 7 days
- High-value visitors: Viewed 5+ products in a session
- Repeat visitors: Visited 3+ times in 30 days
- Purchasers: Completed at least one purchase
These audiences can be shared with Google Ads for remarketing campaigns.
UTM Parameters for Campaign Tracking
UTM parameters let you track exactly which campaigns drive traffic and sales:
- utm_source: The platform (facebook, tiktok, google)
- utm_medium: The type of traffic (cpc, social, email)
- utm_campaign: Your campaign name
- utm_content: The specific ad or creative
Example URL: yourstore.com?utm_source=facebook&utm_medium=cpc&utm_campaign=spring_sale&utm_content=video_ad_1
Always use UTM parameters on your ad URLs. Without them, GA4 cannot attribute sales to specific campaigns accurately.
Common Mistakes to Avoid
Not Filtering Internal Traffic
Your own visits inflate your data. Set up an internal traffic filter in GA4 by going to Admin > Data Streams > your stream > Configure Tag Settings > Define Internal Traffic, and add your IP address.
Ignoring Data for Too Long
GA4 data is only useful if you look at it regularly. Set a weekly calendar reminder to review your key metrics. Even 15 minutes per week of analysis will improve your decision making.
Making Decisions on Small Sample Sizes
Do not draw conclusions from 50 visits. Wait until you have at least 200-300 sessions before making changes based on the data. Small samples produce unreliable patterns.
Not Connecting Google Ads
If you run Google Ads, link your GA4 property to your Google Ads account. This enables conversion tracking in Google Ads and allows you to create remarketing audiences from GA4 data.
Key Takeaways
- Install GA4 on day one because historical data cannot be backfilled
- Enable e-commerce events to track your full purchase funnel
- Review your acquisition report weekly to understand which channels perform best
- Use UTM parameters on every ad for accurate campaign attribution
- Create custom audiences for remarketing and deeper analysis
- Filter out your own traffic to keep your data clean
- Make data-driven decisions but only with sufficient sample sizes
Related Guides
Understanding Conversion Rates: What They Mean and How to Improve Them
Demystify conversion rates for your online store — learn what a good rate looks like, how to calculate it, common benchmarks, and proven strategies to increase yours.
9 min read
The 15 E-Commerce KPIs Every Store Owner Must Track
Discover the key performance indicators that separate thriving stores from struggling ones — from revenue metrics to customer behavior signals and marketing efficiency ratios.
10 min read
Heatmap Analysis: See Exactly How Customers Use Your Store
Learn how to use heatmap tools to visualize where visitors click, scroll, and get stuck on your store pages — then use those insights to boost conversions.
8 min read
Ready to Put This Into Practice?
Launch your own fully automated dropshipping store and start applying these strategies today.