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

# Track revenue from Stripe or a custom payment page

> Send your sales to Radar by connecting Stripe, or by sending a payment event from your own payment page, then check that each sale is attributed.

Radar ties each sale to the visit that led to it, so you can see which sources, pages and devices bring in money. For that, Radar has to hear about your sales. There are two ways: connecting Stripe, and sending a `payment` event from your own payment page. This guide helps you pick the right one, gives the exact call, and shows how to check that a sale was attributed.

Not a developer? Start with the Help Center articles on [connecting Stripe](https://docs.taap.it/help/radar/features/connect-stripe.md) and [reading your revenue](https://docs.taap.it/help/radar/features/revenue.md).

## Pick your method

The answer depends on where your customers type their card details.

| Where customers pay | What you do |
| - | - |
| On the Stripe Checkout page, the payment page hosted by Stripe that your site sends buyers to | Connect Stripe. There is no event to send. |
| On a payment page built into your own site | Connect Stripe, and also send a `payment` event when a sale goes through. |

On a custom payment page, connecting Stripe is not enough on its own.

## Before you start

* **Install the Radar script** on your site, and make sure your visits show up. Radar can only tie a sale to a visit it has seen. See [check your installation](https://docs.taap.it/help/radar/check-your-installation.md).
* **Have a Stripe account.** Stripe is the payment provider Radar connects to.

## Connect Stripe

Open your Radar project and follow the Stripe connection steps shown in the dashboard. Make sure you finish every step.

Once the connection is active:

* your payments feed the revenue figures at the top of the overview, the Revenue page, and the amount spent shown for each buyer on the People page;
* each paying customer is identified automatically, with the email and the name from their payment. See [identify visitors](https://docs.taap.it/radar/guides/identify-visitors.md).

If your customers pay on the Stripe Checkout page, you are done. Go to [check that a sale was attributed](#check-that-a-sale-was-attributed).

## Send a payment event from a custom payment page

When the payment happens on a page you built, your code tells Radar about the sale with `visitors.track`. The call takes three arguments:

```javascript theme={null}
visitors.track(
  "payment",
  {
    email: "jane@example.com",
    first_name: "Jane",
    last_name: "Doe",
    name: "Jane Doe",
  },
  {
    revenue_amount: 49,
    revenue_currency: "USD",
  }
);
```

| Argument | What it is | What to put in it |
| - | - | - |
| 1. Event name | A string. | `"payment"`, written exactly like this. |
| 2. Properties | An object that describes the buyer and the sale. | `email`, `first_name`, `last_name` and `name`. You can add your own properties, such as an order number. |
| 3. Revenue | An object that carries the money. | `revenue_amount`, the amount of the sale, and `revenue_currency`, its currency code, for example `"USD"`. |

Two details matter:

* **The name `payment` is exact.** It is the only event name on which Radar copies the buyer's name to the People page. The email is picked up on any event.
* **The amount and the currency go in the third argument**, not among the properties.

### When to send it

Send the event once the payment is confirmed, not when the buyer clicks the pay button. A declined card would otherwise count as a sale.

Send it once per sale. If the call sits on a confirmation page, make sure that reloading the page does not send it a second time.

```javascript theme={null}
function onPaymentConfirmed(order) {
  if (typeof visitors === "undefined") return;

  visitors.track(
    "payment",
    {
      email: order.customer.email,
      first_name: order.customer.firstName,
      last_name: order.customer.lastName,
      name: order.customer.fullName,
      order_id: order.id,
    },
    {
      revenue_amount: order.total,
      revenue_currency: order.currency,
    }
  );
}
```

In this example, `order` stands for your own order data. The first line skips the call when the Radar script is not loaded, so a blocked script never breaks your checkout. See [protect your code when the script is missing](https://docs.taap.it/radar/guides/custom-events.md#protect-your-code-when-the-script-is-missing).

## Check that a sale was attributed

**1. Make a test purchase**

On your published site, arrive the way a customer would, for example from a link on another site, then buy something.

**2. Look at the overview**

Open your project in Radar. The **Revenue** and **Sales** figures at the top of the overview should include your test sale. If they stay empty, your payments are not connected yet, or the sale could not be matched with a visit.

**3. Open the buyer on the People page**

Go to People and click the buyer. Their history shows their visits, where they came from, and the amount they spent. Compare that amount and its currency with your test sale.

The Revenue page then breaks your sales down by source, location, device, product and customer. The detailed Revenue page is available on the Business plan. Compare plans on the [pricing page](https://taap.it/pricing).

### Check with the API

The same figures can be read from your own tools. The overview endpoint returns `revenue`, `revenue_currency` and `sales` for a date range:

```bash theme={null}
curl -X GET 'https://taap.it/api/v1/radar/overview?start=2026-11-01T00:00:00Z&end=2026-11-30T23:59:59Z' \
  -H 'Authorization: Bearer taapit_your_api_key_here'
```

The [people endpoint](https://docs.taap.it/api-reference/radar/people.md) returns a `revenue` value for each person, and can sort people by revenue. See the [metrics endpoint](https://docs.taap.it/api-reference/radar/metrics.md) for the full answer. The Radar API is available from the Pro plan.

## Sales are missing

Go through these points in order.

1. **The Stripe connection is complete.** Every step shown in the dashboard is done.
2. **You know where customers pay.** On the Stripe Checkout page, the connection covers you. On your own payment page, the `payment` event is required too.
3. **The event is named exactly `payment`**, and the amount and the currency are in the third argument.
4. **Your code reaches the call.** An early `return`, an error just before, or a missing `visitors` object all skip it. The browser console shows the error.
5. **The Radar script is on the site** and your visits show up. See [I installed the script but I see no data](https://docs.taap.it/help/radar/no-data.md).

Still nothing? Contact support from the chat in your dashboard or at [hello@taap.it](mailto:hello@taap.it). Describe the path a buyer follows on your site, from the first page to the payment: it is the first thing the team asks for.

## Good to know

* **No webhooks.** Radar does not notify your systems when a sale is recorded. Read your figures with the [Radar API](https://docs.taap.it/api-reference/radar/introduction.md).
* **Deleting a project deletes its revenue data.** Deleting a Radar project deletes all its data.

> [!NOTE]
>
> This guide is about Radar, the analytics for your website. To track the sales that come from your taap.it links, see [conversion tracking](https://docs.taap.it/conversions/overview.md) instead.

## Next steps

> [card] [Identify visitors](https://docs.taap.it/radar/guides/identify-visitors.md)
>
> Which identity fields Radar reads, and the rule about names.

> [card] [Send custom events](https://docs.taap.it/radar/guides/custom-events.md)
>
> Track the steps before the sale: sign-ups, clicks and forms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.