Talivia
PricingDocsAI agents
English简体中文
Get started
← Back to blog

Talivia guide

How to Track Stripe Revenue by UTM Campaign

Learn how to connect UTM campaign data to Stripe payments, subscriptions, and renewals without confusing checkout events with collected revenue.

Talivia·2026-09-04

A UTM-tagged link can tell you which campaign brought someone to a SaaS website. Stripe can tell you whether that person eventually paid. Neither record, by itself, proves that the visit and payment belong to the same customer journey.

That gap is why Stripe UTM tracking often stops at a conversion event. A campaign report counts a signup or checkout-page view, while the Stripe dashboard records a payment under a customer, Checkout Session, PaymentIntent, or invoice. If the two systems do not share a durable reference, the team cannot reliably connect campaign context to collected revenue.

The solution is not to copy every UTM value onto every Stripe object. It is to preserve the marketing context with the website session, carry a stable attribution reference into checkout, and let verified payment events confirm the financial result. This guide explains that data model, the implementation choices for Stripe Checkout and subscriptions, and the checks required before campaign revenue is safe to use for budget decisions.

Why UTM parameters do not become Stripe revenue automatically

UTM parameters describe a visit. The familiar fields, utm_source, utm_medium, utm_campaign, utm_content, and utm_term, arrive in the landing-page URL. A website analytics tracker can record them with the session and show traffic grouped by campaign. The UTM campaign revenue view becomes possible only after that session is connected to a real payment.

Stripe operates on a different set of objects. Checkout Sessions manage checkout state, PaymentIntents represent payment attempts, Customers represent billing identities, and invoices represent subscription charges. Stripe does not know which browser session first saw utm_campaign=founder_launch unless the application supplies a reference that links the two data sets.

A redirect to hosted Checkout makes this separation easy to see. The visitor lands on your domain with campaign parameters, browses the product, creates an account, and later opens a Stripe-hosted payment page. The original landing URL is not the payment record. Adding the UTMs to the success URL does not solve the problem either, because a customer can pay and close the tab before returning.

Stripe's documentation recommends using metadata to associate your own identifiers with Stripe objects. It also explains that metadata does not copy between every related object automatically. Some mappings are one-time snapshots, while other downstream objects need nested metadata at creation. A sound attribution design therefore identifies one durable join key, stores it on the correct objects, and treats webhook-confirmed payment status as the revenue evidence.

Build the attribution chain before choosing a report

A reliable Stripe revenue attribution chain has four layers:

  1. Campaign context is captured from the landing-page URL.
  2. The context remains attached to an anonymous website session or identified visitor.
  3. Checkout carries an opaque session reference into Stripe.
  4. A verified Stripe event connects the paid object back to that session.

This order matters. Passing raw UTM strings at checkout captures only what is available at checkout time. A SaaS buyer may have arrived from a campaign three weeks earlier, returned directly, signed up, and upgraded from inside the product. If the application reads the current URL when creating Checkout, the original parameters are already gone. If it preserves acquisition context with the visitor and session, the later payment can still be evaluated under a clearly defined attribution model.

The join key should not be an email address embedded in a URL. Email can change, may be unavailable before signup, and creates unnecessary privacy exposure. It should also not be a Stripe secret or an authorization token. An opaque analytics session identifier is sufficient for matching and has no authority to create a payment or access an account.

Talivia follows this structure. It captures campaign parameters on tracked pages, keeps them with session and visitor context, and uses a Talivia session ID as the checkout attribution signal. Stripe confirms that money was paid. The session reference joins that financial event to the marketing journey without requiring Stripe metadata to become a second campaign database.

Connect a Stripe Checkout Session to the website visit

For a custom Checkout Sessions integration, the browser first reads the current Talivia session ID and sends it to the application's backend. The backend still authenticates the user, validates the product and price, and creates Checkout with the Stripe secret key. The session ID is attribution context, not proof that the request is authorized.

Talivia's Stripe Checkout attribution page summarizes the supported flow, while the implementation guide for Checkout Sessions provides code for both one-time and subscription modes. The important implementation detail is where the reference is written.

For a one-time Checkout payment, put talivia_session_id in top-level Checkout Session metadata and in payment_intent_data.metadata. The top-level value is present on the Checkout event. The nested value is set on the underlying PaymentIntent, which makes the reference available when that object reports success. For subscription mode, use top-level metadata and subscription_data.metadata so the initial Checkout and the resulting Subscription retain the relationship.

Keep {CHECKOUT_SESSION_ID} in the success URL as a fallback and diagnostic signal. It can help match the return visit to the verified Checkout Session, but it should not be the only way to confirm revenue. Stripe notes in its Checkout guidance that customers might not reach the success page after completing payment. Webhooks exist precisely because financial events can finish asynchronously or without a browser return.

This separation also handles delayed payment methods correctly. A completed Checkout Session is not always paid. The attribution reference can exist before the money is confirmed, but the campaign must not receive revenue until Stripe reports a paid outcome. Checkout state is a useful operational signal; collected payment status is the business result.

Use webhooks as payment evidence, not as the acquisition source

A Stripe webhook supplies the authoritative transition in the payment lifecycle. Stripe's webhook documentation requires signature verification using the raw payload, the Stripe-Signature header, and the endpoint signing secret. Without verification, an incoming request is not trustworthy payment evidence.

The webhook does not need to carry all marketing dimensions if it carries a payment object that can be joined to the session reference. The attribution system can read the session, recover its UTM values, landing page, referrer, and tracked activity, then associate those dimensions with the confirmed payment. This keeps the roles clear:

  • the browser session records marketing and product context;
  • Stripe records payment and subscription state;
  • the session reference connects the two;
  • the attribution model decides which source or campaign receives credit.

Webhook handlers also need duplicate and ordering tolerance. Stripe can retry an event, and related Checkout, PaymentIntent, and invoice events do not have to arrive in the order a developer expects. Revenue should be keyed and reconciled by stable provider objects rather than incremented blindly every time a success-shaped payload arrives. Otherwise one payment can appear twice and make a campaign look more valuable than it is.

After ingestion, inspect the underlying website sessions, not just the campaign total. A paid row should lead to a plausible session with the expected UTM values and checkout activity. That trace is more useful than a polished chart when you are diagnosing whether the join is working.

Keep subscription acquisition separate from renewal activity

Subscription attribution introduces a time problem. The first invoice may follow an interactive checkout, but later invoices are usually created and paid without a new website visit. Assigning every renewal to the latest arbitrary session invents a touchpoint that may not exist. Assigning renewals to the original acquisition campaign answers a different, legitimate question: which acquired customers continue to produce revenue?

For Stripe subscription mode, preserve the Talivia session reference on both the initial Checkout Session and the Subscription. Identify the signed-in visitor with the stable application user and Stripe Customer relationship. Later invoices can then reconnect through the customer and subscription even though no browser opens at renewal time. The Stripe subscriptions and invoices guide documents the supported setup and lifecycle events.

Reports should label this logic explicitly. "Renewal revenue by original acquisition campaign" is accurate when renewals inherit the established customer relationship. "Campaigns that caused this month's renewals" is not. The old campaign did not necessarily prompt each recurring charge; it acquired the customer whose subscription remained active.

Refunds require the same discipline. Gross paid revenue and net revenue after refunds answer different questions. A campaign can generate a valid initial payment that is later partially or fully refunded. Keeping the original payment context while reversing the refunded amount preserves both the acquisition history and the financial outcome.

Decide which UTM values deserve operational trust

Attribution cannot rescue inconsistent campaign naming. linkedin, LinkedIn, and linkedin.com may become three sources. A spring launch called spring_launch in one ad and spring-launch in another will split the report. Decide conventions before links are distributed, and document who owns them.

Use utm_source for the platform or publisher, utm_medium for the channel type, and utm_campaign for the initiative that a budget owner can recognize. Use utm_content to distinguish creatives or links only when that level will support a real decision. Reserve utm_term for paid keyword context where it is genuinely populated. Do not put personal data, customer emails, or secrets in UTM parameters because URLs can be stored in browser history, analytics systems, server logs, and shared messages.

Campaign values should also survive redirects. Test the final landing URL rather than only the link entered into an ad manager. Link shorteners, affiliate redirects, and application routers can drop query parameters. The landing-page revenue report helps distinguish a campaign-tagging failure from a checkout-matching failure: if tagged sessions never appear on the expected landing page, fix acquisition capture before debugging Stripe.

Unknown traffic must stay unknown. An untagged private message, a bookmark, or a privacy-constrained browser may provide no useful source. Backfilling a campaign because it seems likely produces a cleaner dashboard and a weaker decision. Attribution should expose missing evidence rather than disguise it.

Validate the full path with a small test matrix

A green webhook status is not enough. Provider connection and attribution are separate checks. Test the exact checkout paths used in production and compare the browser journey, Stripe object, and Talivia payment record.

Start with a UTM-tagged URL in a normal browser session. Confirm the campaign values and landing page are recorded. Complete a one-time test payment and verify that the Checkout Session or PaymentIntent contains the expected opaque session reference, the payment appears once, and the attributed session matches the visit. Then repeat with a direct return before purchase to check how your chosen first-touch or last-touch view behaves.

For subscriptions, confirm the initial payment, Stripe Customer, and Subscription are connected. Trigger a test renewal and verify that it appears as a separate invoice payment tied to the same customer relationship, not as a duplicated signup. Test a failed invoice and a refund so neither is mistaken for new positive revenue. If you accept delayed methods, verify that a merely completed but unpaid Checkout Session contributes no revenue before asynchronous success.

Finally, compare totals. Sum the relevant Stripe payments for the tested period and reconcile them with imported paid and refunded records. Then sample several attributed and unattributed payments. The unattributed set is especially valuable because it reveals Payment Links shared away from the tracked site, checkouts created without metadata, blocked tracking, identity gaps, and return pages that never loaded.

Turn campaign revenue into a budget decision

Once the chain is verified, campaign reporting can move beyond conversion counts. Compare paid customers, gross revenue, refunded revenue, and renewal revenue under a stated attribution model. Keep traffic volume nearby so a campaign with a few high-value customers is not hidden by one that produces many low-intent visits.

Do not treat attributed revenue as causal proof. A first-touch campaign may have introduced the customer while product onboarding and email completed the sale. A last-touch campaign may have captured existing demand. The report assigns credit according to a rule; the inspectable journey explains whether that rule is useful for the decision.

Talivia brings UTM context, landing pages, sessions, customer identity, and verified Stripe payments into the same workflow. That makes it possible to move from "this campaign generated checkouts" to "these paid records are connected to sessions acquired by this campaign," with the matching evidence available for review.

If campaign tags and Stripe revenue still live in separate reports, create a Talivia account, install tracking on the acquisition and return pages, and connect the Stripe flow your product actually uses. Validate one payment end to end before scaling the analysis. A small traceable data set is a stronger foundation for marketing spend than a large table of unverified conversions.

Keep reading

More from Talivia

Continue with the latest practical guides for analytics and revenue attribution.

2026-09-03

First-Touch vs Last-Touch Attribution for SaaS

Learn how first-touch and last-touch attribution work for SaaS, where each model fails, and how to connect acquisition sources to paid revenue.

Read article →
Talivia

Connect website sessions and payments. See which traffic creates revenue.

Copyright © 2025-2026 Talivia. All rights reserved.

Product

Revenue attributionTraffic breakdownSession activitySearch ConsolePricingAI Agent KitBot trafficWebsite analytics

Compare

All alternativesDataFast alternativePlausible alternativeUmami alternativeGoogle Analytics alternativeSimple Analytics alternative

Resources

BlogDocumentationAI crawler directoryGitHubHow it worksFAQGet started

Legal

Privacy policyTerms of service