> AI agents: this is one page of nextanalytica's docs. The full index for agents: https://nextanalytica.app/llms.txt

# Revenue tracking

> Track revenue on your website so every order ties to the visit, channel and campaign it came from, from the browser, your server or WooCommerce.

Updated: 2026-11-29

Revenue tracking ties each order on your site to the visit it came from, so you can see which channels and campaigns make money, not only traffic. With [nextanalytica](/), you record an order with one call, `order({ ref, value, currency })`, from the page, from your server or from the WordPress plugin for WooCommerce. Your agent then reads revenue by channel, campaign and landing page, in your project's currency, and next to ad spend.

## How do you record an order?

From the page where the order is confirmed:

```js
window.nextanalytica.order({ ref: "A-10492", value: 129.9, currency: "EUR" });
```

`ref` is your order's reference, so the same order sent twice counts once. The currency is three capitals, such as `EUR` or `USD`.

## What about orders the browser never sees?

Some payments are confirmed later or elsewhere: a bank transfer, a subscription renewal, a payment page on another domain. Send those from your server with a server key, as an `order` event with your own user id:

```bash
curl -X POST https://t.nextanalytica.app/s \
  -H "Authorization: Bearer nask_…" -H "Content-Type: application/json" \
  -d '{"events":[{"type":"order","user_id":"u_42","value":49,"currency":"EUR","ref":"A-1001"}]}'
```

An order from your server belongs to no visit, so it counts under the channel "Server". Keep the key on your servers, never in a page. See [Segment and RudderStack](/docs/tracking/segment-and-rudderstack#what-do-you-need) for how to make one.

On WordPress, the nextanalytica plugin counts WooCommerce orders as purchases on its own. See [WordPress and WooCommerce](/docs/tracking/wordpress).

## How do you read revenue?

Revenue is kept in each order's own currency, and turned into your project's currency where you compare across them. Ask your agent:

- "Revenue by channel this month, against last month."
- "Which campaigns brought orders, and which only brought visits?"
- "Which landing pages lead to the most revenue per visit?"
- "What's our return on ad spend by platform?"

Return on ad spend is revenue divided by ad spend, both in your project's currency: 2 means 2 back for each 1 spent. It needs an ad account connected as a source, such as ChatGPT Ads. See [Sources](/docs/sources).

## What about revenue from AI assistants?

Orders in visits from ChatGPT, Claude or Perplexity count in the AI assistants channel, and your agent can see the orders in visits that followed an assistant's fetch of the same page. See [AI traffic analytics](/docs/tracking/ai-traffic).

## Next steps

- [Custom events](/docs/tracking/custom-events)
- [UTM tags](/docs/learn/utm-tags)
- [Tag JavaScript API](/docs/reference/tag-api)
- [ChatGPT Ads conversion tracking](/docs/tracking/chatgpt-ads-conversion-tracking)

Canonical address: https://nextanalytica.app/docs/learn/revenue-tracking
