E-commerce Analytics: Track Revenue from Click to Checkout
Full-funnel e-commerce tracking with revenue dashboards, product performance metrics, and purchase funnel analysis. Know exactly where revenue is won and lost.
The Gap in Analytics for Online Stores
Most analytics tools tell you how many people visited your site. Some tell you which pages they viewed. But the question that actually matters for an e-commerce business is different: where exactly are you losing revenue?
Google Analytics 4 introduced enhanced e-commerce tracking, but the setup is complex, the reports are confusing, and the data model forces you to work with Google's assumptions about your funnel. Dedicated e-commerce analytics tools like Mixpanel or Amplitude are powerful but expensive, and they don't give you the server-side observability you need when your checkout API goes down at 2 AM.
JustAnalytics now includes full e-commerce analytics -- revenue tracking, product performance, funnel analysis, and attribution -- all integrated with the same error tracking, session replay, and APM you already use.
E-commerce Event Tracking
JustAnalytics follows a standard e-commerce event model that maps to the real customer journey. Each event captures structured data about products, transactions, and user behavior.
The E-commerce Event Flow
view_item → add_to_cart → begin_checkout → add_payment_info → purchase
↓
remove_from_cart
Every step in the funnel is a trackable event with rich metadata.
Tracking Product Views
JustAnalytics.track('view_item', {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Headphones Pro',
item_brand: 'AudioTech',
item_category: 'Electronics',
item_category2: 'Audio',
item_category3: 'Headphones',
item_variant: 'Matte Black',
price: 49.99,
quantity: 1,
}],
});
Tracking Add to Cart
JustAnalytics.track('add_to_cart', {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Headphones Pro',
item_brand: 'AudioTech',
item_category: 'Electronics',
price: 49.99,
quantity: 1,
}],
});
Tracking Purchases
JustAnalytics.track('purchase', {
transaction_id: 'TXN-789456',
currency: 'USD',
value: 124.97,
tax: 10.00,
shipping: 5.99,
coupon: 'SPRING20',
items: [
{
item_id: 'SKU-12345',
item_name: 'Wireless Headphones Pro',
price: 49.99,
quantity: 1,
},
{
item_id: 'SKU-67890',
item_name: 'USB-C Charging Cable',
price: 14.99,
quantity: 5,
},
],
});
Server-Side Purchase Validation
For reliable revenue tracking, we recommend validating purchases server-side. The Node.js SDK supports e-commerce events:
import { track } from '@justanalyticsapp/node';
app.post('/api/checkout/complete', async (req, res) => {
const order = await processPayment(req.body);
// Track validated purchase server-side
track('purchase', {
transaction_id: order.id,
currency: order.currency,
value: order.total,
tax: order.tax,
shipping: order.shipping,
items: order.items.map(item => ({
item_id: item.sku,
item_name: item.name,
price: item.price,
quantity: item.quantity,
})),
});
res.json({ success: true, orderId: order.id });
});
Server-side tracking prevents data loss from ad blockers, network failures, and users closing the tab before the client-side event fires.
Revenue Dashboards
Once e-commerce events are flowing, JustAnalytics builds revenue dashboards automatically. No configuration required.
Revenue Overview
The revenue overview panel shows:
- Total revenue for the selected period with comparison to previous period
- Number of transactions and average order value (AOV)
- Revenue per visitor (RPV) -- total revenue divided by unique visitors
- Revenue trend -- a time series chart showing revenue by hour, day, or week
- Revenue by source -- which traffic channels drive the most revenue
Key Metrics
| Metric | Definition |
|---|---|
| Revenue | Sum of all purchase event values |
| Transactions | Count of unique transaction_id values |
| AOV | Revenue / Transactions |
| RPV | Revenue / Unique Visitors |
| Cart Abandonment Rate | 1 - (Purchases / Add to Carts) |
| Checkout Abandonment Rate | 1 - (Purchases / Begin Checkouts) |
| Conversion Rate | Transactions / Sessions |
All metrics support filtering by date range, traffic source, country, device type, and custom segments.
Product Performance
The product performance report breaks down metrics at the individual item level, so you can see which products drive your business and which underperform.
Product Table
For each product, JustAnalytics tracks:
- Views -- how many times the product was viewed (view_item events)
- Add to Carts -- how many times it was added to a cart
- Purchases -- how many times it was part of a completed purchase
- Revenue -- total revenue generated by the product
- View-to-Cart Rate -- Add to Carts / Views
- Cart-to-Purchase Rate -- Purchases / Add to Carts
- Average Selling Price -- Revenue / Units Sold
Product Category Rollups
If you use the hierarchical category fields (item_category, item_category2, item_category3), JustAnalytics provides drill-down reports by category:
Electronics (Total: $45,230)
├── Audio ($12,400)
│ ├── Headphones ($8,200)
│ └── Speakers ($4,200)
├── Accessories ($18,300)
└── Cables ($14,530)
This helps merchandising teams understand which categories are trending and where to focus marketing spend.
Brand Performance
Similarly, the item_brand field enables brand-level analysis:
- Revenue by brand
- Average order value by brand
- Conversion rate by brand
- Brand affinity (which brands are frequently purchased together)
Purchase Funnel Analysis
The purchase funnel is the most actionable report in e-commerce analytics. It shows exactly where potential customers drop off, quantified in both users and revenue.
Funnel Stages
JustAnalytics constructs the funnel automatically from your e-commerce events:
Product View → 100,000 users (100%)
↓ 32% proceed
Add to Cart → 32,000 users
↓ 45% proceed
Begin Checkout → 14,400 users
↓ 78% proceed
Add Payment Info → 11,232 users
↓ 85% proceed
Purchase → 9,547 users (9.5% overall)
Drop-off Analysis
For each stage where users drop off, JustAnalytics provides:
- Drop-off count -- how many users left at this stage
- Revenue impact -- estimated revenue lost based on average order value
- Common exit pages -- where users went after abandoning
- Device breakdown -- whether drop-off rates differ by device
- Session replay access -- watch recordings of sessions that dropped off at this stage
This is where the integration with session replay becomes invaluable. If 55% of users are abandoning at the checkout stage, you can filter session replays to show only sessions that reached checkout but didn't purchase. Watch ten of those recordings and you'll almost certainly find the UX issue.
Funnel Comparison
Compare funnels across dimensions to identify optimization opportunities:
- Desktop vs Mobile -- is your mobile checkout flow causing more drop-offs?
- New vs Returning -- do returning visitors convert at higher rates?
- Traffic Source -- which channels bring the highest-converting traffic?
- Country -- are there localization issues affecting conversion in specific markets?
- Time Period -- did last week's redesign improve or hurt the funnel?
Integration with Attribution Models
E-commerce analytics becomes even more powerful when combined with JustAnalytics attribution modeling. Attribution answers the question: which marketing channels actually drive revenue?
Supported Attribution Models
| Model | Description |
|---|---|
| Last Click | 100% credit to the last touchpoint before purchase |
| First Click | 100% credit to the first touchpoint |
| Linear | Equal credit to all touchpoints |
| Time Decay | More credit to touchpoints closer to purchase |
| Position Based | 40% first, 40% last, 20% distributed to middle |
| Data Driven | Algorithmic attribution based on your data |
Revenue Attribution Report
The revenue attribution report shows, for each channel:
- Attributed revenue under each model
- ROAS (Return on Ad Spend) if you import cost data
- Revenue per session by attributed channel
- Assisted conversions -- how often this channel appears in multi-touch journeys without getting last-click credit
Example: Revenue Attribution (Last 30 Days)
Channel | Last Click | Data Driven | Assisted
Organic Search | $42,300 | $38,100 | 1,240
Paid Search | $28,500 | $31,200 | 890
Email | $18,200 | $22,400 | 2,100
Social | $8,100 | $12,800 | 1,850
Direct | $15,400 | $8,000 | 320
Campaign ROI
Track campaigns end-to-end by using UTM parameters. JustAnalytics attributes revenue to specific campaigns, ad groups, and even individual ads:
Campaign: Spring Sale 2026
Spend: $5,000
Revenue (Data Driven): $31,200
ROAS: 6.24x
Transactions: 312
New Customers: 189
Returning Customers: 123
Setting Up E-commerce Tracking
Step 1: Enable E-commerce Mode
In your site settings, toggle E-commerce Analytics to enabled. This activates the revenue dashboards and product reports.
Step 2: Instrument Your Store
Add event tracking to your storefront. If you're using a framework like Next.js or React:
// hooks/useEcommerceTracking.ts
import { useCallback } from 'react';
export function useEcommerceTracking() {
const trackProductView = useCallback((product: Product) => {
window.JustAnalytics?.track('view_item', {
currency: 'USD',
value: product.price,
items: [{
item_id: product.sku,
item_name: product.name,
item_brand: product.brand,
item_category: product.category,
price: product.price,
}],
});
}, []);
const trackAddToCart = useCallback((product: Product, quantity: number) => {
window.JustAnalytics?.track('add_to_cart', {
currency: 'USD',
value: product.price * quantity,
items: [{
item_id: product.sku,
item_name: product.name,
price: product.price,
quantity,
}],
});
}, []);
const trackPurchase = useCallback((order: Order) => {
window.JustAnalytics?.track('purchase', {
transaction_id: order.id,
currency: order.currency,
value: order.total,
tax: order.tax,
shipping: order.shipping,
items: order.items.map(item => ({
item_id: item.sku,
item_name: item.name,
price: item.price,
quantity: item.quantity,
})),
});
}, []);
return { trackProductView, trackAddToCart, trackPurchase };
}
Step 3: Validate with Real-Time View
Open the JustAnalytics real-time dashboard and place a test order. You should see events flowing in immediately:
view_itemwhen you view a productadd_to_cartwhen you add to cartpurchasewhen you complete checkout
Step 4: Add Server-Side Validation (Recommended)
For the most accurate revenue data, add server-side purchase tracking using the Node.js SDK. This ensures purchases are recorded even if the client-side event fails.
What's Different from GA4
If you're migrating from Google Analytics 4's enhanced e-commerce, here's what changes:
- Simpler setup -- no GTM data layer required, just JavaScript function calls
- Real-time revenue -- see purchases the moment they happen, not hours later
- Session replay integration -- watch what users did before abandoning checkout
- Server-side validation -- use the same SDK for both analytics and APM
- No data sampling -- JustAnalytics processes 100% of your e-commerce events
- No data retention limits -- keep your revenue data as long as you need it
- Privacy compliant -- no cookies means no consent banner needed
Start Tracking Revenue Today
E-commerce analytics is available now on all JustAnalytics plans. Add your first e-commerce event, and the revenue dashboards will populate automatically.
If you're running an online store and want analytics that actually help you make money, start your 7-day free trial.
The engineering and product team behind JustAnalytics. We're on a mission to make web observability simpler, faster, and more private.