virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
blog / 2026-11-18

Stripe Payment Link UTM tracking: see which source sold

By Devendra Variya, co-founder of Virling. Published 2026-11-18, updated 2026-11-28.

To see which channel brought each Stripe Payment Link sale, the payment has to carry an ID that points back to the visit. Stripe does not keep the UTM tags or the referrer of the page that sent the buyer to buy.stripe.com, so on its own every sale looks the same. Put a visitor ID in the link's client_reference_id, record the visit's source on your side, and join the two. With the Virling script on the page, that takes no code: it tags every Payment Link, and each sale shows its channel.

What Stripe keeps and drops on a Payment Link

  • UTM tags on your page: dropped. They are on your landing URL, not on the Payment Link, so Stripe never sees them. Payment Links accept utm_source, utm_medium, utm_campaign, utm_content and utm_term only when they are in the link URL itself, and Stripe's docs describe passing them on to your redirect URL after payment (Stripe Payment Link URL parameters). Tags you hard-code on a link describe the link, not the visit.
  • Referrer: dropped. A Checkout Session has no field for the page or site that sent the buyer, so the payment does not say where the visit came from.
  • client_reference_id: kept. Add it to the link URL, with letters, digits, dashes and underscores up to 200 characters, and Stripe copies it onto the Checkout Session. It arrives in the checkout.session.completed event. Invalid values are dropped without an error.

Step by step, for the values people send through a Payment Link. "Not described" means the two Stripe pages below say nothing about it:

ValueOn the payment pageOn the Checkout SessionOn your redirect URL
UTM tags on your page URLNever reach itNoNo
UTM tags in the Payment Link URLAccepted: letters, digits, dashes and underscores, up to 150 charactersNot describedYes, when the link is set to redirect after payment
client_reference_idNot a field the buyer fills inYes, and in checkout.session.completedNot described
prefilled_emailFills the email field, and the buyer can change itNot describedNot described
locked_prefilled_emailFills the email field, and the buyer cannot change itNot describedNot described
prefilled_promo_codeFills the code, when the link allows promotion codesNot describedNot described

Sources: URL parameters and customize a Payment Link. Prefilled fields help the buyer type less. They do not say which channel the sale came from.

So client_reference_id is the one place a Payment Link can carry the source of a sale. One short visitor ID is enough, because the visits behind it, with their UTM tags and referrers, live in your analytics. What else the field can hold, and how to read it back, is in Stripe client_reference_id.

Track the source of a Payment Link with no code

Step 1: add the script to the pages that hold the link. One tag in the <head> of each page with a Buy button; copy yours from the app:

<script defer src="https://app.virling.com/v.js" data-site="yourdomain.com"></script>

Each visit, with its referrer and UTM tags, is stored under the ID in the first-party virling_vid cookie.

Step 2: leave your Payment Links as they are. A plain link is enough:

<a href="https://buy.stripe.com/abc123">Buy now</a>

The script adds client_reference_id with the visitor ID to every buy.stripe.com link when the page loads and again on click, and never replaces a value that is already there.

Step 3: connect Stripe with a restricted key. On each sync Virling finds the Checkout Session behind a Payment Link charge, reads its client_reference_id and credits the visit with that ID. The key's read permissions are listed in the Stripe docs.

Step 4: test one sale. Use a test-mode key and a test Payment Link, visit your page from a tagged URL such as ?utm_source=test, and click the link. The buy.stripe.com address now ends in client_reference_id=v.... Pay with a Stripe test card, and after the next sync the sale carries the test source.

The whole Stripe setup, Payment Links included, is on the Stripe integration page. If members join a paid community through a subscription Payment Link, Stripe membership analytics shows how each renewal keeps the channel of the first payment.

Start free trial

One sale, from tagged link to payments list

Example only: the buyer, the ID, the price and the times are made up. Someone sells a $49 course with one Payment Link and posts about it on LinkedIn.

  1. The post links to the page, not to Stripe: https://yourdomain.com/course?utm_source=linkedin.com&utm_medium=social&utm_campaign=course-launch.
  2. The buyer lands at 10:02. The script stores the visit with those tags against the visitor ID vexample1042.
  3. The buyer clicks Buy now. The link is now https://buy.stripe.com/abc123?client_reference_id=vexample1042. The UTM tags stay behind, and that is fine.
  4. The buyer pays at 10:14. Stripe creates a Checkout Session with client_reference_id set to vexample1042, and a $49.00 charge.
  5. The next sync joins them. Virling reads the charge, finds its session, takes the ID and credits the visit at 10:02.

The row in the payments list at /app/yourdomain.com/payments, for this example:

CustomerSourceSpentTime to complete
A generated nameLinkedIn, with the channel Social under it$49.0012m

Open the row and the journey shows one visit, marked Credited, with Campaign course-launch. Under Details, Visitor is vexample1042. Had the post linked straight to buy.stripe.com, the same $49.00 would show as Unattributed. The social UTM link generator writes the tagged page link.

Where you paste the link decides what you see

A Payment Link is just a URL, so it ends up in many places. Only a click that starts on a page running the script carries a visitor ID.

  • Bios and link-in-bio pages. A buy.stripe.com link in a profile bio, or on a link-in-bio page you do not host, opens Stripe straight from the app. Put a tagged link to your own page there instead, such as ?utm_source=instagram.com&utm_medium=social, and keep the Payment Link on that page.
  • Emails and newsletters. The same holds for a Buy button in an email. Link the button to your sales page with UTM tags; the extra page costs one click and gives every sale from that email its campaign.
  • Site builders. Pasting the link into a button in Framer, Webflow, Carrd, Wix, Squarespace or WordPress works when the published button is a normal <a href> and the script is in the site's head. Click the button on the live site: if the Stripe address shows client_reference_id, it is tagged. The guides under By site builder show where the script goes in each one.
  • Chat and DMs. A Payment Link sent in a chat, a DM or a support reply never passes through your site. Those sales stay Unattributed in Virling; send a link to your page when you want them counted by source.

One link per campaign, or one link for all

With the script on your page, one Payment Link is enough for every campaign. The source and campaign come from the tagged page visit, and each visitor's click gets its own client_reference_id, so two buyers from two campaigns never share an ID.

Separate links per campaign only help where buyers skip your site, such as a bio or a chat. Stripe lists the payments of each link on that link's page in the Dashboard, so you can count sales per link there, but Virling still has no visit for them and shows them as Unattributed. Separate links also mean separate prices and settings to keep in step.

If the link already has a client_reference_id

Some people add their own value to a Payment Link, such as ?client_reference_id=spring-promo to mark a campaign or an order number from another tool. The script never overwrites it, and Virling reads whatever is there as the visitor ID. No visit has the ID spring-promo, so the sale shows as Unattributed.

Take the value off the link and let the script fill it; the campaign is already in the visit's UTM tags. If you need your own ID on the payment too, create the Checkout Session on your server, put your ID in client_reference_id and the visitor ID in metadata.virling_vid, as in Stripe Checkout UTM parameters.

When a Payment Link sale has no source

  • The link was opened off your site. Links in emails, QR codes, social posts or other sites never pass through a page with the script, so they carry no visitor ID and show as Unattributed. Send people to a page on your site instead, and let them click through from there.
  • The link is on a custom domain. The script only tags links on buy.stripe.com. For a Payment Link on your own checkout domain, add the ID yourself from window.virling.vid().
  • The button is not a link. The link must be a normal <a href>. A button that opens the URL from JavaScript is not tagged.
  • Cookieless mode. With data-cookieless there is no visitor ID to pass, so new payments are Unattributed.

Symptoms, causes and fixes. Open the Unattributed payment and look for Visitor under Details. If there is none, the link did not carry the ID.

What you seeCauseFix
Sales from your site have a source, sales from a newsletter have noneThe newsletter links straight to buy.stripe.comLink to a page that runs the script, with UTM tags, and put the Payment Link there
Every sale from one link has no visitor IDThe link is on your own checkout domain, which the script does not tagSet client_reference_id on it from window.virling.vid(), or use the buy.stripe.com link
The payment page URL has no client_reference_idJavaScript opens the link, so there is no <a href> to tagUse a normal <a href> link
The URL has a client_reference_id, the Checkout Session has noneThe value has a character Stripe does not allow, such as @, and was dropped without an errorUse only letters, digits, dashes and underscores, up to 200 characters
Visitor is your own user or order IDThe link already had a client_reference_id, which is read as the visitor IDTake it off the link. If you need both, create the session on your server and set metadata.virling_vid
There is a visitor ID, but the payment is UnattributedNo visit of that visitor was recorded inside the lookback window before the paymentRun the script on every page where people arrive, and choose a longer window if buyers take longer
No visitor ID for buyers who declined cookiesThe script is in cookieless mode, or Until consent is on and the visitor has not acceptedExpected: without the cookie there is no ID to pass
UTM tags in the link URL are missing on your thank-you pageThe link shows Stripe's confirmation page, or a value is over 150 characters or not allowedSet the link to redirect after payment and shorten the value

A payment made before a fix usually stays Unattributed, so make a new one to check. Every other cause is in Unattributed revenue.

If you create Checkout Sessions on your server instead of using Payment Links, you pass the ID yourself; see Stripe Checkout UTM parameters. For payment forms on your own page, see Stripe embedded checkout UTM tracking and Stripe Elements UTM tracking, and for an embedded table of plans, Stripe pricing table UTM tracking.

By site builder

Frequently asked questions

Does a Stripe Payment Link keep the UTM parameters from my page?

No. The tags are on your page URL, not on the buy.stripe.com link, so Stripe never sees them. Stripe only reads utm_source, utm_medium, utm_campaign, utm_content and utm_term when they are in the Payment Link URL itself, and passes them on to your redirect URL after payment.

Can I see the referrer of a Payment Link sale in Stripe?

No. A Checkout Session has no field for the page or site that sent the buyer, so the payment does not say where the visit came from. You need your own record of the visit and an ID that joins it to the payment.

Do I need code to track the source of a Payment Link?

Not with Virling. Put the script on the pages that hold the link and connect Stripe with a restricted key. The script adds client_reference_id to every buy.stripe.com link, and Virling matches the payment to the visit.

What if my Payment Link already has a client_reference_id?

The script never replaces a value that is already there, so your own ID stays. Virling then reads it as the visitor ID, finds no visit for it, and the sale shows as Unattributed.

Why does a Payment Link sale show as Unattributed?

The buyer did not reach the link from a page running the script: they opened it from an email, a QR code, a social post or another site. It also happens when the link is on a custom domain instead of buy.stripe.com, when it is opened by a button without an a href, or when the script runs in cookieless mode.

Do I need a separate Payment Link for each campaign?

No. One Payment Link can serve every campaign when people reach it from a page that runs the script. Put the UTM tags on the link to your page. The script gives each visitor's click its own client_reference_id, so the sales stay apart.

Can I put a Payment Link in my Instagram bio?

You can, but sales from it show as Unattributed, because the buyer goes from the app straight to buy.stripe.com and no page with the script runs. Put a link to your own page in the bio, with UTM tags such as utm_source=instagram.com, and keep the Payment Link on that page.

See which campaigns bring Stripe revenue

Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.

Start free trial See the demo