Revenue Attribution
Connect your payment provider to track revenue and attribute it to marketing channels.
Revenue Attribution
EngageTrack links every dollar of revenue back to the marketing channel that drove it. Know exactly which campaigns, referrers, and landing pages generate real business results — not just clicks.
How Attribution Works
Revenue attribution follows a four-step pipeline:
- Visitor tracking — The EngageTrack SDK generates a persistent visitor ID (stored in
localStorage) and a session ID (stored insessionStorage) that identify the visitor and their current session, along with the traffic source that brought them. - Metadata passthrough — When the visitor starts a checkout, your client reads these IDs via the SDK and passes them as metadata to your payment provider (Stripe, LemonSqueezy, Paddle, or Polar).
- Webhook delivery — After payment, the provider sends a webhook to EngageTrack containing the payment amount and the metadata you attached.
- Source linking — EngageTrack reads
engagetrack_visitor_idfrom the webhook metadata, looks up the visitor's traffic source, and attributes the revenue accordingly.
The result: every payment appears in your Revenue dashboard broken down by source, campaign, landing page, and country.
Supported Providers
| Provider | Integration Method | Guide |
|---|---|---|
| Stripe | Checkout Sessions, Payment Links, PaymentIntent | Stripe Checkout, Payment Links, PaymentIntent |
| LemonSqueezy | Checkout API, Checkout Links | LemonSqueezy |
| Paddle | Overlay Checkout, Checkout API | Paddle |
| Polar | Checkout API | Polar |
Quick Start
The integration is the same across all providers:
// 1. Read the visitor/session IDs from the SDK (client-side)
const visitorId = window.engagetrack.getVisitorId();
const sessionId = window.engagetrack.getSessionId();
// 2. Send them to your server and include as metadata when creating a checkout
const checkout = await createCheckout({
metadata: {
engagetrack_visitor_id: visitorId,
engagetrack_session_id: sessionId,
},
});
// 3. Configure the webhook URL in your provider dashboard
// https://api.engagetrack.net/api/v1/webhooks/revenue/{provider}/{YOUR_SITE_PUBLIC_ID}Both engagetrack_visitor_id and engagetrack_session_id should be passed
for best attribution accuracy. The visitor ID links the payment to a person,
while the session ID links it to the specific session (and therefore the
exact traffic source) that led to the purchase.
Reading the Visitor & Session IDs
The SDK exposes two helper methods to read the IDs on the client side:
const visitorId = window.engagetrack.getVisitorId();
const sessionId = window.engagetrack.getSessionId();On the server side, receive the IDs from the client request body:
// Node.js / Express — receive IDs from the client request body
app.post("/create-checkout", async (req, res) => {
const { engagetrack_visitor_id, engagetrack_session_id } = req.body;
// Pass these as metadata to your payment provider
});// Next.js App Router — receive IDs from the client request body
import { NextRequest, NextResponse } from "next/server";
export async function POST(request: NextRequest) {
const { engagetrack_visitor_id, engagetrack_session_id } =
await request.json();
// Pass these as metadata to your payment provider
}What Shows Up in the Dashboard
Once attribution is configured, the Revenue tab in your dashboard displays:
- Total revenue over time with trend charts
- Revenue by source — see which referrers, UTM campaigns, and channels drive the most revenue
- Revenue by landing page — identify your highest-converting pages
- Revenue by country — geographic breakdown of payments
- Attribution — revenue is attributed to the traffic source from the visitor's most recent session at the time of purchase
Next Steps
Choose the guide for your payment provider:
- Stripe Checkout — the most common integration
- Stripe Payment Links — no server code required
- Stripe PaymentIntent — for custom checkout flows
- LemonSqueezy
- Paddle
- Polar