Back to all articles
AnalyticsRevenueGrowth••5 min read

How to Track True Revenue Attribution for SaaS and E-Commerce

Learn how to connect payment providers like Stripe, Paddle, and Polar directly to your acquisition channels, campaigns, and landing pages.

Alex Morgan
Alex MorganHead of Growth
How to Track True Revenue Attribution for SaaS and E-Commerce

Most web analytics tools tell you where your traffic comes from, but they stop short when it comes to the only metric that truly matters: revenue.

When a visitor clicks an ad on Twitter or discovers your product on GitHub, traditional analytics records a pageview. But when that same visitor pays $49 a week later through Stripe or Polar, your analytics is completely blind.

The Attribution Gap
Without direct payment integration, up to 68% of marketing spend is attributed incorrectly due to multi-touch delays, browser privacy protections, and session resets.

The Problem with Traditional Pageview Metrics#

Traditional analytics tools optimize for pageviews, bounce rates, and session durations. While these metrics look nice on an investor update deck, they frequently mislead growth teams:

  1. High Traffic, Low Intent: A blog post ranking for generic keywords might bring 50,000 visitors per month while generating $0 in subscription revenue.
  2. Low Traffic, High Value: A technical comparison page or developer docs page might receive only 200 visits a month but drive $12,000 in monthly recurring revenue (MRR).
  3. Misallocated Ad Spend: Ad channels with low cost-per-click often attract unqualified leads who never convert past the free trial.
Real-World Impact
$18,400+42% attributed ARR

Average revenue recovered after switching from raw pageview attribution to unified server-side payment attribution.

Connecting Stripe and Polar to Eleven#

Connecting your payment provider is straightforward and requires zero complex database engineering. Eleven handles webhooks and securely links customer sessions.

Setting up the JavaScript Client SDK#

First, install the Eleven lightweight tracking snippet in your application root:

analytics.tstypescript
import { initEleven } from "@eleven/analytics";export const analytics = initEleven({  projectId: process.env.NEXT_PUBLIC_ELEVEN_ID,  cookieless: true,  autoTrackOutbound: true,});

Passing the Checkout Session Identifier#

When initiating a Stripe Checkout session or Polar purchase, simply attach the client session token to your payment metadata:

analytics.tstypescript
// pages/api/create-checkout-session.tsimport Stripe from "stripe";const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);export async function createCheckout(req, res) {  const { visitorId, priceId } = req.body;  const session = await stripe.checkout.sessions.create({    payment_method_types: ["card"],    line_items: [{ price: priceId, quantity: 1 }],    mode: "subscription",    metadata: {      eleven_visitor_id: visitorId,    },    success_url: `${process.env.NEXT_PUBLIC_URL}/success`,    cancel_url: `${process.env.NEXT_PUBLIC_URL}/pricing`,  });  return res.json({ url: session.url });}
Automatic Webhook Ingestion
Eleven automatically listens to checkout.session.completed and invoice.payment_succeeded events, matching the payment amount directly to the referrer URL and UTM campaign.

Understanding Multi-Touch Attribution Models#

When evaluating customer journeys, different attribution models provide unique insights into your acquisition funnel:

ModelBest ForKey Advantage
First TouchTop of funnel campaignsIdentifies original discovery channels
Last TouchDirect conversion pagesHighlights final trigger before purchase
Linear Multi-TouchFull lifecycle evaluationGives equal credit across entire journey
Time-DecayedSales cycles > 30 daysGives progressive credit to closer interactions

Conclusion#

When revenue is placed directly next to your traffic sources, marketing decisions become crystal clear. You stop guessing which campaigns work and start doubling down on the channels that genuinely drive sustainable revenue.

Start Tracking True Revenue Today

Connect Stripe, Polar, or Paddle in less than 3 minutes. Zero cookie banners required.

Start 14-day free trial
Alex Morgan
Written by Alex Morgan(Head of Growth)

Building open-source, cookieless analytics and revenue attribution tools at Eleven.

Continue reading

Analytics you'll actually check.Every single day.

You are just a couple of minutes away from bringing your dashboard to life.