Skip to content
DocsAnalytics & reports
ANALYTICS & REPORTS

Revenue tracking

Connect website visits to the sales and the ads that brought them. Install one script, report your orders, and compare results with Meta.

6 min read8 sectionsUpdated September 14, 2026
Open Revenue setup
01

How it works

A small script on every page measures visits, sources and campaigns. Your store reports each completed order, and Revenue credits the sale back to the visit — and the ad — that produced it.

No payment-provider account is required. Visits start arriving as soon as the script is installed and consent is granted.

02

Register your website

  1. Open Revenue in your dashboard and enter your website or store address.
  2. Click Continue to setup. This creates the site and its public site key.
  3. Check the currency and timezone. If you will compare with Meta, match your Meta ad account.
The site key is public

It identifies your website and is safe in HTML. The signing secret is private and belongs on your server only.

03

Choose how to install

Pick one method. Installing the script twice — say in your code and in Tag Manager — counts every visit twice.

In Setup, Copy installation prompt gives your coding assistant ready-made instructions with your site key and script URL. It contains no secret. The assistant still needs access to your website's code.

Choose how to install
MethodBest forOrders
HTMLAny site where you can edit the shared page template.purchase() on the confirmation page
ShopifyShopify stores.Shopify webhook (verified)
Google Tag ManagerSites that already manage tags through GTM.purchase() on the confirmation page
Next.jsNext.js App Router applications.purchase() on the confirmation page
04

Install the tracker

Copy the snippet from Revenue → Setup for your method — it already contains your site key. The examples below use a placeholder.

HTML

Paste the snippet into the <head> of the template every page uses.

index.html · inside <head>
<script defer data-site="YOUR_PUBLIC_SITE_KEY"
  data-consent="required"
  src="https://adriselab.com/s.js?v=4"></script>

Shopify

The script also writes the visitor ID into the cart automatically, so Shopify carries it onto the order — no extra code.

  1. In Shopify admin, open Online Store → Themes.
  2. Next to your live theme, choose Edit code and open theme.liquid.
  3. Paste the snippet immediately before </head> and save.
theme.liquid · before </head>
<script defer data-site="YOUR_PUBLIC_SITE_KEY"
  data-consent="required"
  src="https://adriselab.com/s.js?v=4"></script>
Orders come from a webhook

Shopify's checkout does not run third-party scripts, so connect orders as described under Report completed orders → Shopify orders.

Google Tag Manager

  1. In your GTM container, click New Tag and choose Custom HTML.
  2. Paste the snippet.
  3. Set the trigger to All Pages.
  4. Save, then Submit and publish the container.
Custom HTML tag
<script defer data-site="YOUR_PUBLIC_SITE_KEY"
  data-consent="required"
  src="https://adriselab.com/s.js?v=4"></script>
Install in one place only

If the script is also in your site's code, remove one of them. Two installs count every visit twice.

Next.js

Place the component inside <body> in app/layout.tsx, so it loads on every route.

app/layout.tsx
import Script from "next/script";

// inside <body>
<Script
  src="https://adriselab.com/s.js?v=4"
  data-site="YOUR_PUBLIC_SITE_KEY"
  data-consent="required"
  strategy="afterInteractive"
/>
Client-side navigation is handled

Route changes are measured without extra code. Do not also load the script through Tag Manager.

06

Report completed orders

The tracker measures visits on its own, but it cannot read an order total. A site without sales can skip this step.

HTML, Tag Manager and Next.js

Call purchase() on your order-confirmation page with the real order ID, amount and currency. On Next.js, call it from a client component once the order is confirmed.

value is in your currency's major units — 129.00 means 129, not cents. Reuse the same order ID on reload; a repeated order is never counted twice. Browser-reported sales are labelled unverified in Transactions.

Order confirmation
window.adriselab.purchase({
  orderId: String(order.id),
  value: order.total,
  currency: order.currency,
});
Need verified revenue?

Your payment server can send signed server events instead. Setup → Advanced has a ready-to-copy Node.js example. Keep the signing secret on the server.

Shopify orders

Orders come from Shopify itself, and sales received this way are labelled verified.

  1. In AdRiseLab, open Revenue → Settings → Shopify and copy the webhook URL.
  2. In Shopify admin, go to Settings → Notifications → Webhooks and create an Order payment webhook to that URL, format JSON.
  3. Optionally add a Refund create webhook to the same URL so refunds are subtracted.
  4. Shopify shows a signing secret once. Paste it into Revenue → Settings → Shopify.
Do not add purchase() to a Shopify theme

It will never run. Orders placed before the webhook existed are not imported, and orders that skip the storefront (POS, draft orders) count as revenue but are credited to no campaign.

07

Verify the installation

Setup shows a live status for the selected website. It turns green once the first event arrives. Use a separate test site for synthetic purchases so you do not contaminate production reporting.

  1. Open your website in a normal browser window and grant analytics consent.
  2. Navigate to a second page.
  3. Return to Revenue → Setup and confirm the status shows a recent event.
  4. Check Visitors. If an automated or headless test is missing, turn on Show crawler traffic.
  5. For a store, place a test order and confirm it appears once in Transactions.
  6. Repeat the same test order ID and confirm it does not add a second order.
  7. Check the order’s verification label and test any refund integration you installed.
08

Diagnose missing or different numbers

If visits are missing, check the selected site, actual installed site key, consent, script loading, date range, and crawler filter first.

If visits arrive but sales do not, inspect the order integration. The storefront script alone does not mean that order reporting is configured.

If Meta and Revenue disagree, compare their date ranges and measurement methods. Meta’s attributed conversions and the website ledger are distinct sources; neither should be silently substituted for the other.