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.
Open Revenue setupHow 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.
Register your website
- Open Revenue in your dashboard and enter your website or store address.
- Click Continue to setup. This creates the site and its public site key.
- Check the currency and timezone. If you will compare with Meta, match your Meta ad account.
It identifies your website and is safe in HTML. The signing secret is private and belongs on your server only.
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.
| Method | Best for | Orders |
|---|---|---|
| HTML | Any site where you can edit the shared page template. | purchase() on the confirmation page |
| Shopify | Shopify stores. | Shopify webhook (verified) |
| Google Tag Manager | Sites that already manage tags through GTM. | purchase() on the confirmation page |
| Next.js | Next.js App Router applications. | purchase() on the confirmation page |
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.
<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.
- In Shopify admin, open Online Store → Themes.
- Next to your live theme, choose Edit code and open theme.liquid.
- Paste the snippet immediately before </head> and save.
<script defer data-site="YOUR_PUBLIC_SITE_KEY"
data-consent="required"
src="https://adriselab.com/s.js?v=4"></script>Shopify's checkout does not run third-party scripts, so connect orders as described under Report completed orders → Shopify orders.
Google Tag Manager
- In your GTM container, click New Tag and choose Custom HTML.
- Paste the snippet.
- Set the trigger to All Pages.
- Save, then Submit and publish the container.
<script defer data-site="YOUR_PUBLIC_SITE_KEY"
data-consent="required"
src="https://adriselab.com/s.js?v=4"></script>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.
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"
/>Route changes are measured without extra code. Do not also load the script through Tag Manager.
Connect analytics consent
The snippet carries data-consent="required", so the tracker loads but collects nothing until you release it. Call consent(true) when your consent manager reports analytics permission — including a choice saved on an earlier visit — and consent(false) when it is withdrawn.
Prefer no cookie banner? Tick Use cookieless tracking in Setup instead. That snippet carries data-cookieless="on", stores nothing on the visitor's device and needs no consent call. The trade-off: the visitor identifier resets daily, so returning visitors and next-day attribution are lost.
// When your consent manager grants analytics permission:
window.adriselab?.consent(true);
// When permission is withdrawn:
window.adriselab?.consent(false);Until consent(true) runs, nothing is collected. Wire this call up before diagnosing a broken install.
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.
window.adriselab.purchase({
orderId: String(order.id),
value: order.total,
currency: order.currency,
});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.
- In AdRiseLab, open Revenue → Settings → Shopify and copy the webhook URL.
- In Shopify admin, go to Settings → Notifications → Webhooks and create an Order payment webhook to that URL, format JSON.
- Optionally add a Refund create webhook to the same URL so refunds are subtracted.
- Shopify shows a signing secret once. Paste it into Revenue → Settings → Shopify.
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.
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.
- Open your website in a normal browser window and grant analytics consent.
- Navigate to a second page.
- Return to Revenue → Setup and confirm the status shows a recent event.
- Check Visitors. If an automated or headless test is missing, turn on Show crawler traffic.
- For a store, place a test order and confirm it appears once in Transactions.
- Repeat the same test order ID and confirm it does not add a second order.
- Check the order’s verification label and test any refund integration you installed.
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.