> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ecommerce revenue

> Track orders, customers, refunds, and the storefront journey.

Ecommerce attribution needs both sides of the order: storefront tracking captures why the customer arrived, and the commerce source supplies the final payment record.

## Before you connect

Install web tracking on every landing and storefront page. For Shopify, use the [Shopify install](/installation/shopify) so the App Embed and Web Pixel cover storefront and checkout surfaces.

## Setup

<Steps>
  <Step title="Connect the commerce source">
    Open **Sources** and connect Shopify or Checkout Champ. Complete every step shown by the source dialog.
  </Step>

  <Step title="Check the source status">
    The source should show as connected without an error or action-needed state.
  </Step>

  <Step title="Run a customer journey">
    Start in a private window with test UTM parameters, view a product, and continue through checkout.
  </Step>

  <Step title="Place a test order">
    Use the platform's supported test payment method. Record the order ID, total, currency, and customer email.
  </Step>

  <Step title="Inspect the order">
    Find it in **Events**, then open the customer in **Users** to confirm the visit and order are connected.
  </Step>
</Steps>

## Shopify metrics

Datalyr can report gross revenue, net revenue, refunded amount, paid orders, average order value, unique customers, first-time and repeat orders, items sold, discounted orders, and completed checkouts. Net revenue is gross revenue minus recorded refunds.

## Keep amounts comparable

Compare the same date range, timezone, currency, and order state. A platform may show authorized, pending, test, or unpaid orders in a view that Datalyr does not count as paid revenue.

Taxes, shipping, discounts, and platform fees can also change which total you are comparing. Start with one known order and compare its transaction-level amount before comparing an entire month.

## Common failures

* **Order is missing:** confirm it reached the paid state and the source is connected to the correct account.
* **Order exists but has no campaign:** the landing visit was not tracked, the Shopify App Embed was off, or identity was lost before checkout.
* **Revenue is doubled:** the same order is arriving from more than one source or custom purchase event.
* **Totals differ:** align order status, timezone, currency, refunds, and the definition of gross versus net revenue.

<Note>
  Fix missing attribution before scaling paid traffic. A later backfill can restore orders, but it cannot recreate browser context that was never captured.
</Note>
