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:

  1. Visitor tracking — The EngageTrack SDK generates a persistent visitor ID (stored in localStorage) and a session ID (stored in sessionStorage) that identify the visitor and their current session, along with the traffic source that brought them.
  2. 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).
  3. Webhook delivery — After payment, the provider sends a webhook to EngageTrack containing the payment amount and the metadata you attached.
  4. Source linking — EngageTrack reads engagetrack_visitor_id from 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

ProviderIntegration MethodGuide
StripeCheckout Sessions, Payment Links, PaymentIntentStripe Checkout, Payment Links, PaymentIntent
LemonSqueezyCheckout API, Checkout LinksLemonSqueezy
PaddleOverlay Checkout, Checkout APIPaddle
PolarCheckout APIPolar

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: