Docs menuTrack revenue › Connect your payments
Count sales from any checkout
On this page
Count the sales of any other checkout, PayPal or your own, from the page buyers reach once they have paid.
Before you start
Install CentPath on every page, your thank-you page included: the page buyers reach once they have paid, and at no other time. Each sale is counted from there, in the visit of the buyer who reached it, under the source that visit came from.
1. Tell CentPath how buyers pay you
- In CentPath, open your site and go to Setup → Sales.
- Under How do buyers pay you?, pick Something else. Setup shows both ways below, with your site's currency in the code.
2. Report each sale from your thank-you page
Pick the way that fits your thank-you page.
With code: the sale and its amount
On your thank-you page, call this once the order is paid, with the order's own amount, currency and id:
window.analytics.goal("purchase", {
revenueMinorUnits: 4900, // 49.00 USD, in its smallest unit
currency: "USD",
id: orderId, // counts each sale once
});- Put the amount in
revenueMinorUnitsas a whole number in the currency's smallest unit:4900for 49.00 USD,49for 49 JPY. - Put the amount's three-letter currency code in
currency. Each currency is counted apart, never converted: see Currency. - Put the order's id in
id, so a buyer who reloads the page counts once.
Send goals from JavaScript has the details.
Without code: the order id in the address
If you can't add code but your checkout can send buyers to a thank-you address of your choice, add this to its end, with the order's id in place of ORDER_ID:
?ap_order=ORDER_ID- If the address already has a ?, start with & instead.
- Use an id that is the order's own, so each sale counts once.
The sale counts, as an order with no amount: it adds to Orders, not to Revenue.
Verify the setup
- Make a purchase, or wait for your next sale, and let the thank-you page load.
- Open your dashboard. If Orders isn't among the figures at the top, click Configure above them and turn it on. Then switch the chart to Orders: the sale is there, under the source of the visit that brought it. With an amount, it is in Revenue too.
Troubleshooting
A sale counts twice
The id changed between the two loads, or there was none. Send the order's own id, the same each time the page loads.
A sale shows with no amount
An order id in the address counts the sale with no amount. Report it with code, as above, to count its amount.
A sale reported with code never shows
Open your browser's console on the thank-you page. [analytics] goal: bad revenueMinorUnits means the amount isn't a whole number of 0 or more, or has no currency, and the sale was not sent. No message at all? Check that the page loads the snippet: Check your installation shows how.
Sales with an amount stopped counting
Your site accepts amounts from its payment provider alone: Setup → Sales → Currency and amounts has the box ticked. While it is, a sale your code sends with an amount is refused. Untick it if your thank-you page reports sales. How revenue is counted explains why it is there.
A visit to the thank-you page counts a sale that never happened
The page loads for people who didn't pay: a bookmark, a link shared, a test. Report the sale only when your checkout confirms the payment, and keep the page for buyers alone.