Back to Playbooks
Technical & Analytics

How to set up analytics to track every sale

Complete guide to e-commerce analytics setup. Learn Google Analytics 4, e-commerce tracking, conversion funnels, customer behavior analysis, and data-driven decision making to optimize your store.

13 min readIntermediateUpdated Nov 2025

You found this playbook through search. That means the SEO, content strategy, and technical optimization worked. Setting up analytics requires the same strategic approach. Let me help you get there.

Analytics are the foundation of data-driven e-commerce. Without proper tracking, you are making decisions blind. Comprehensive analytics reveal what works, what does not, and where to invest for maximum ROI.

This playbook covers complete analytics setup for e-commerce. From Google Analytics 4 configuration to e-commerce tracking, conversion funnels to customer behavior—these strategies provide actionable insights that drive revenue growth.

1
What is Google Analytics 4 (GA4) and why is it important?

Google Analytics 4 is the latest version of Google Analytics, replacing Universal Analytics (which stopped processing data in July 2023). GA4 provides event-based tracking, better privacy compliance, and advanced e-commerce capabilities.

GA4 Key Features:
Event-Based Tracking

Tracks user interactions as events (page views, clicks, purchases). More flexible than pageview-based tracking. Enables detailed behavior analysis.

Enhanced E-Commerce Tracking

Built-in e-commerce tracking for purchases, product views, add-to-cart, checkout steps. Provides comprehensive sales and product performance data.

Cross-Platform Tracking

Tracks users across websites, apps, and platforms. Provides unified view of customer journey. Essential for omnichannel businesses.

Privacy-First Design

Designed for privacy regulations (GDPR, CCPA). Uses modeling for data gaps, respects user privacy, and provides consent management.

Machine Learning Insights

AI-powered insights, predictive metrics, and anomaly detection. Identifies trends and opportunities automatically.

Migration Note: If you still use Universal Analytics, migrate to GA4 immediately. Universal Analytics stopped processing data in July 2023. GA4 is the only option going forward.

2
How do you set up e-commerce tracking in Google Analytics?

E-commerce tracking enables detailed sales analysis, product performance, and customer behavior insights. Setup varies by platform, but core principles are the same across all e-commerce stores.

E-Commerce Tracking Setup Steps:
1
Create GA4 Property

Set up Google Analytics 4 property, get measurement ID (G-XXXXXXXXXX), and configure basic settings (timezone, currency, data retention).

2
Install Tracking Code

Add GA4 tracking code to your website. Most platforms (Shopify, WooCommerce, BigCommerce) have built-in GA4 integration—just enter measurement ID.

3
Enable Enhanced E-Commerce

Enable e-commerce tracking in GA4 settings. Configure data streams, enable e-commerce events, and set up product data collection.

4
Configure Purchase Events

Set up purchase event tracking with product data (name, price, quantity, category). Most platforms do this automatically when e-commerce tracking is enabled.

5
Test Tracking

Make test purchase, verify events fire correctly in GA4 Real-Time reports, check product data is captured, and ensure revenue tracking works.

Platform-Specific Setup:
Shopify: Settings → Analytics → Google Analytics → Enter GA4 measurement ID
WooCommerce: Install GA4 plugin, enter measurement ID, enable e-commerce tracking
BigCommerce: Store Settings → Analytics → Google Analytics → Enter measurement ID
Custom Stores: Add gtag.js or Google Tag Manager, implement e-commerce events manually

3
What e-commerce metrics should you track?

Tracking the right metrics enables data-driven decisions. Too many metrics create analysis paralysis. Focus on metrics that directly inform business decisions and optimization strategies.

Essential E-Commerce Metrics:
Revenue

Total sales revenue. Track daily, weekly, monthly. Compare periods to identify trends. Most important metric—everything else supports revenue growth.

Transactions

Number of completed purchases. Track transaction volume and trends. Increasing transactions indicates growth.

Average Order Value (AOV)

Revenue ÷ Transactions. Track AOV trends. Increasing AOV increases revenue without more customers. Upsells and cross-sells increase AOV.

Conversion Rate

(Transactions ÷ Sessions) × 100. Percentage of visitors who purchase. Track overall and by traffic source. Higher conversion rate = more efficient traffic.

Product Performance

Track which products sell best, revenue per product, views vs. purchases, and product conversion rates. Optimize bestsellers, improve underperformers.

Customer Acquisition Cost (CAC)

Marketing spend ÷ New customers. Track CAC by channel. Lower CAC = more efficient marketing. Compare to customer lifetime value (CLV).

Customer Lifetime Value (CLV)

Total revenue per customer over their lifetime. Track CLV trends. Increasing CLV increases profitability. Compare to CAC (CLV should be 3-5x CAC).

Cart Abandonment Rate

Percentage of carts that do not convert. Track abandonment rate and identify drop-off points. Reducing abandonment increases revenue.

Traffic Sources

Track which channels drive traffic and sales (organic, paid, social, email, direct). Invest in best-performing channels, optimize underperformers.

Metric Hierarchy: Revenue is the ultimate metric. All other metrics support revenue growth. Focus on metrics that directly impact revenue: conversion rate, AOV, traffic quality.

4
How do you track conversion funnels?

Conversion funnels reveal where customers drop off in the purchase process. Understanding funnel performance identifies optimization opportunities and increases conversion rates.

E-Commerce Funnel Steps:
Step 1: Product View

Users view product pages. Track product views, which products get most views, and view-to-cart conversion rate. Low view-to-cart indicates product page issues.

Drop-off Analysis: If many views but few add-to-carts, optimize product pages (pricing, images, descriptions)
Step 2: Add to Cart

Users add products to cart. Track add-to-cart events, cart abandonment rate, and products added. High add-to-cart but low checkout indicates checkout issues.

Drop-off Analysis: If many add-to-carts but few checkouts, optimize checkout process (shipping costs, form complexity)
Step 3: Checkout Start

Users begin checkout process. Track checkout starts, checkout abandonment, and time spent in checkout. Identifies checkout friction points.

Drop-off Analysis: High checkout abandonment indicates checkout issues (form complexity, trust signals, payment options)
Step 4: Purchase

Completed transactions. Track purchase completion rate, revenue, and products purchased. Final conversion metric.

Success Metric: Overall conversion rate from product view to purchase
Funnel Tracking Setup in GA4:
  • Use GA4's Funnel Exploration report to visualize funnel steps
  • Create custom funnel reports for specific product categories or campaigns
  • Track drop-off percentages at each step to identify biggest issues
  • Compare funnels by traffic source to see which channels convert best
  • Set up funnel visualization in Google Data Studio for regular monitoring

5
What is UTM parameter tracking and why is it important?

UTM parameters track traffic sources in URLs, enabling attribution of sales to specific campaigns, channels, and ads. Without UTM tracking, you cannot measure marketing ROI or optimize ad spend.

UTM Parameters Explained:
utm_source

Identifies traffic source (google, facebook, email, newsletter). Required parameter.

Example: ?utm_source=google
utm_medium

Identifies marketing medium (cpc, email, social, organic, referral). Required parameter.

Example: &utm_medium=cpc
utm_campaign

Identifies specific campaign (summer_sale, product_launch, black_friday). Highly recommended.

Example: &utm_campaign=summer_sale
utm_term

Identifies paid search keywords (for Google Ads). Optional, mainly for paid search.

Example: &utm_term=running_shoes
utm_content

Identifies specific ad or link variation (A/B testing). Optional, for detailed tracking.

Example: &utm_content=ad_variant_a
Complete UTM Example:
https://yoursite.com/products/shoes?utm_source=google&utm_medium=cpc&utm_campaign=summer_sale&utm_term=running_shoes&utm_content=ad_variant_a

This URL tells GA4: Traffic came from Google (source), via paid search (medium), in summer sale campaign, for "running shoes" keyword, using ad variant A.

UTM Best Practices:
  • Use consistent naming conventions (lowercase, underscores, no spaces)
  • Add UTMs to all marketing links (email, social, ads, content)
  • Use UTM builder tools (Google Campaign URL Builder) to create URLs correctly
  • Document UTM structure so team uses consistent parameters
  • Review UTM data regularly to ensure tracking accuracy

6
How do you track customer behavior and user journeys?

Understanding customer behavior reveals how users navigate your site, which pages they visit, and what actions they take. Behavior tracking enables optimization based on actual user patterns.

Customer Behavior Tracking:
User Journey Reports

GA4's User Journey report shows complete customer path from first visit to purchase. Identifies common paths, drop-off points, and conversion patterns.

Behavior Flow Analysis

Track how users navigate between pages. See which pages lead to purchases, which pages cause exits, and common navigation patterns.

Event Tracking

Track specific user actions: button clicks, form submissions, video plays, downloads, scroll depth. Custom events reveal detailed behavior.

Customer Lifetime Value

Track customer value over time, purchase frequency, and customer segments. Identify high-value customers and their behavior patterns.

Session Recordings & Heatmaps

Use tools like Hotjar to see actual user sessions, mouse movements, clicks, and scroll behavior. Visual insights complement analytics data.

Behavior Analysis Use Cases:
  • Identify High-Converting Paths: Replicate successful user journeys in design and navigation
  • Find Drop-Off Points: Identify where users leave and optimize those pages
  • Optimize Navigation: Improve site structure based on actual user behavior
  • Personalize Experiences: Use behavior data to personalize content and recommendations
  • Improve UX: Fix friction points identified through behavior analysis

7
What other analytics tools complement Google Analytics?

Google Analytics provides comprehensive data, but specialized tools offer deeper insights. Combining multiple tools provides complete picture of performance and user behavior.

Complementary Analytics Tools:
Hotjar (Heatmaps & Session Recordings)

Visual behavior analysis: heatmaps show where users click, scroll, and focus. Session recordings show actual user sessions. Reveals UX issues analytics miss.

Best for: UX optimization, identifying friction points, visual behavior insights
Mixpanel (Advanced Event Tracking)

Advanced event tracking and user analytics. Better for complex user journeys, product analytics, and cohort analysis. More detailed than GA4 for specific use cases.

Best for: Product analytics, user segmentation, advanced event tracking
Facebook Pixel (Social Media Tracking)

Tracks Facebook/Instagram ad performance, conversion events, and audience building. Essential for social media advertising optimization.

Best for: Facebook/Instagram ad tracking, social media ROI, audience building
Platform Analytics (Shopify Analytics, etc.)

Built-in platform analytics provide store-specific insights: inventory, fulfillment, customer data. Complements GA4 with operational data.

Best for: Operational metrics, inventory insights, platform-specific data
Segment (Data Integration)

Centralizes data from multiple sources, sends to analytics tools, and provides unified customer view. Simplifies multi-tool analytics setup.

Best for: Data integration, unified analytics, complex setups

Tool Selection: Start with GA4 (free, comprehensive). Add Hotjar for UX insights. Add Facebook Pixel if running social ads. Add specialized tools as needs grow. Do not overwhelm with too many tools initially.

8
How do you use analytics data to improve conversions?

Analytics data is useless without action. Using data to inform optimization decisions increases conversion rates systematically. Data-driven optimization is more effective than guesswork.

Data-Driven Optimization Strategies:
Identify High-Performing Pages

Find pages with highest conversion rates. Analyze what makes them successful (design, copy, layout). Replicate successful elements on other pages.

Find Funnel Drop-Off Points

Identify where customers abandon in funnel. High drop-off at checkout? Optimize checkout. High drop-off at product pages? Improve product pages.

Analyze Traffic Sources

Compare conversion rates by traffic source. Invest more in high-converting channels, optimize or reduce spend on low-converting channels.

Track Product Performance

Identify best-selling products and low-performing products. Optimize bestsellers (better placement, promotions), improve or discontinue underperformers.

Monitor Customer Behavior

Use behavior data to improve UX. If users scroll past important content, move it higher. If users click unexpected elements, make them more prominent.

A/B Test Based on Data

Use analytics insights to form hypotheses. Test changes based on data, not assumptions. Data-driven A/B tests have higher success rates.

Track Optimization Impact

Measure before/after metrics for all optimizations. Verify improvements, identify what works, and scale successful changes.

Optimization Workflow:
1
Analyze Data: Review analytics, identify opportunities, form hypotheses
2
Implement Changes: Make optimizations based on data insights
3
Measure Results: Track metrics before/after, compare performance
4
Iterate: Scale successful changes, refine based on results, repeat process

Your analytics setup roadmap

Setting up comprehensive analytics requires systematic implementation. Follow this roadmap to track every sale and gain actionable insights.

1
Week 1: Google Analytics 4 Setup

Create GA4 property, install tracking code, configure basic settings, verify tracking works, and set up data streams.

Deliverables: GA4 installed, tracking verified, basic setup complete
2
Week 2: E-Commerce Tracking

Enable enhanced e-commerce, configure purchase events, set up product tracking, test with real purchase, and verify data accuracy.

Deliverables: E-commerce tracking active, purchase events verified
3
Week 3: Conversion Funnels

Set up funnel steps, configure event tracking, create funnel reports, identify drop-off points, and document funnel structure.

Deliverables: Funnels configured, drop-off analysis available
4
Week 4: UTM & Attribution

Set up UTM parameter structure, add UTMs to all marketing links, configure attribution models, and verify source tracking.

Deliverables: UTM tracking active, attribution configured
5
Week 5: Custom Events & Dashboards

Set up custom events (clicks, form submissions, video plays), create custom reports, build dashboards, and configure alerts.

Deliverables: Custom events tracking, dashboards created
6
Ongoing: Monitoring & Optimization

Monitor analytics regularly, analyze trends, identify opportunities, implement optimizations based on data, and track improvement impact.

Deliverables: Regular monitoring, data-driven optimizations, continuous improvement

Related playbooks

Need expert help setting up analytics?

Analytics setup requires technical expertise, configuration knowledge, and strategic planning. If you want comprehensive tracking that provides actionable insights without the complexity, that is what I specialize in.

Let's build something amazing

Ready to turn your vision into reality?

From AI-powered websites to conversion-optimized funnels, let's discuss your project and create something extraordinary together.

What I can do for you:

SEO Optimization

Boost your search rankings and drive organic traffic

Website Development

Fast, responsive websites that convert visitors

AI Agent Development

Custom AI solutions that automate your workflow

Conversion Optimization

Turn more visitors into customers with data-driven changes

E-commerce Solutions

Build online stores that sell more and convert better

Performance Optimization

Speed up your site and improve user experience

Let's build something amazing.

Let's start the conversation