E-commerce analytics: reconcile orders, refunds, and margin
A dependable commerce model follows the customer and order journey from demand creation through payment, delivery, returns, and contribution.
Central idea
Commerce performance cannot be understood from orders alone. Customer acquisition, payment, inventory, fulfilment, cancellation, return, discount, and product cost must remain connected at a usable grain.
Decision flow
Technology context
Relevant platforms and patterns—not a prescribed stack.
Make refunds traceable to the original transaction
Retain order-line and transaction identifiers through payments, shipments, and refunds. An order with several items may have more than one shipment or refund. Aggregate those events to the intended grain before joining them, or the join can inflate revenue and cost. Use the order and payment systems to reconcile the ledger; web analytics captures a different part of the journey.
- Test a partial refund, failed payment, duplicate purchase event, and split shipment.
- Display the treatment of tax, shipping, discounts, fees, and product cost.
- Reconcile event counts with the commerce backend and explain tracking gaps.
One order is a chain of events
An order may be created, paid, partially fulfilled, cancelled, returned, refunded, discounted, or replaced at different times. Reporting only the creation event can overstate demand and disconnect commercial performance from the customer experience and operational cost.
The data model should preserve order, item, customer, product, payment, promotion, shipment, and return identifiers so each view can be reconciled to the underlying journey.
Reconcile commercial meaning before visualizing it
Revenue, gross sales, net sales, discount, refund, shipping income, tax, product cost, and channel fees require explicit treatment. Finance, commercial, product, and operations teams should approve the definitions and timing rules used in the analytical layer.
- Separate order date, payment date, fulfilment date, and return date.
- Preserve original currency and approved conversion treatment.
- Make cancellations, partial returns, and failed payments visible.
- Connect stock availability and fulfilment performance to conversion signals.
Serve different decisions from one governed model
Leadership needs growth, margin, customer, and service signals. Trading teams need product, pricing, and promotion detail. Operations needs inventory, fulfilment, cancellation, and return visibility. Marketing needs acquisition and journey context. These views should use the same reconciled facts rather than separate exports.
Introduce prediction after the journey is stable
Demand forecasting, propensity, recommendations, and churn models become more useful when historical availability, promotions, customer consent, fulfilment, and returns are represented accurately. A model should not learn that an unavailable product had no demand or that a refunded order created full value.
Sources and further reading
- Google Analytics: measure ecommerce
Implementation reference for purchase and refund events and transaction identifiers. Analytics events still need reconciliation to order and payment records.
- Microsoft Learn: star schema design in Power BI
Technical reference for fact-table grain, dimensions, and historical changes. The implementation checks below are GGMS editorial recommendations.
Sources checked 9 September 2026.
This article offers implementation guidance, not a report of a GGMS client engagement. The sources below support the referenced technical concepts; the proposed checks should be adapted to your systems and reviewed by the relevant business owner.