Trace
Settings

Revenue attribution

Connect Stripe to see which channels bring in paying customers.

Settings → Revenue connects your Stripe account so Trace can attribute revenue to the channel that first brought each customer. It needs the Editor role or above.

Connect Stripe

  1. In Stripe, create a restricted API key with read-only access to Checkout Sessions and Subscriptions.
  2. Paste it into Restricted API key (it starts with rk_live_) and click Connect Stripe.

Trace registers a webhook on your Stripe account for you — there's nothing to paste into Stripe's dashboard. The tab then shows Stripe connected with the date. Disconnect removes the connection.

To attribute a payment, Trace needs to know which visitor made it. When you create a Stripe Checkout Session in your backend, read the df_visitor_id cookie from the incoming request and pass it as the session's client_reference_id:

// Example: Node.js backend creating a Checkout Session
const visitorId = req.cookies["df_visitor_id"];

const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  line_items: [{ price: "price_123", quantity: 1 }],
  success_url: "https://example.com/thank-you?session_id={CHECKOUT_SESSION_ID}",
  client_reference_id: visitorId,
});

The df_visitor_id cookie is set by the tracking script on your root domain, so your backend receives it on requests from your site.

  • Revenue is credited to the visitor's first-touch channel — how they first arrived.
  • Subscriptions created outside Checkout, or Checkout Sessions without a matching client_reference_id, are recorded as unattributed.
  • Duplicate webhook deliveries are ignored.

Cookieless mode

With cookieless / privacy mode on, Trace doesn't use the browser's visitor ID, so payments can't be matched to visitors and all revenue shows as unattributed.

Currency

Pick the currency used to format revenue figures on the dashboard: USD, EUR, GBP, INR, AUD or CAD. It only changes formatting, not amounts.

Where revenue shows

Open Insights from the dashboard's toolbar to see total revenue for the selected range, the number of conversions and Revenue by channel. Revenue is never shown on shared dashboards.

Payment events vs. revenue

Separately from revenue attribution, the tracking script records a payment event when a visitor returns from a Stripe, Polar or Lemon Squeezy checkout, or when you call window.datafast("payment", { email }). These events show in visitor timelines and can be used as goals and alert triggers, but they don't carry amounts — revenue figures come from the Stripe connection above.

On this page