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

# SvelteKit revenue tracking

> Record orders in a SvelteKit app, from the browser or from your server, so revenue ties to the visit, channel and campaign it came from.

Updated: 2026-12-01

In SvelteKit, record an order with `order({ ref, value, currency })` in the component the confirmation page renders. `ref` makes a repeated call count once.

## How does it look?

```svelte title="src/lib/OrderConfirmed.svelte"
<script>
  import { onMount } from 'svelte'
  import { order } from '@nextanalytica/tag'

  export let orderRef
  export let total
  onMount(() => order({ ref: orderRef, value: total, currency: 'EUR' }))
</script>

<p>Thanks for your order.</p>
```

## What about payments confirmed later?

Send them from a server endpoint as `order` events with a server key: see [Revenue tracking](/docs/learn/revenue-tracking#what-about-orders-the-browser-never-sees).

## What can you ask your agent?

- "Revenue by channel this month, against last month."
- "Which campaigns brought orders?"

## Next steps

- [SvelteKit analytics](/docs/platforms/svelte)
- [Revenue tracking](/docs/learn/revenue-tracking)

Canonical address: https://nextanalytica.app/docs/platforms/svelte/orders
