logo
Marketing Digital•

Stripe Conversion Tracking: Connect Each Payment to the Link That Sold It

How to tie every Stripe payment to the link, QR code or campaign that brought the buyer, with Payment Links, your own checkout button, Checkout Sessions or the pricing table.

Avatar for undefined
CodeQR Team
Content Team

Stripe records every payment, but it only knows what you pass into the checkout. The buyer pays on Stripe's own domain, so the cookies and campaign tags on your website stay behind. Stripe conversion tracking closes that gap: you pass an identifier for the visit into the payment, usually in Stripe's client_reference_id field, and read it back when Stripe reports the completed checkout. With CodeQR, that identifier is the click or scan on a short link or QR code, so each sale lands on the link, the code and the campaign that started it.

Buyers reach a Stripe checkout in one of four ways, and each takes a slightly different setup. Facts about Stripe come from Stripe's documentation as it read on October 28, 2026.

Why Stripe alone can't tell you which campaign sold

A Stripe payment carries the amount, the product, the customer details entered at checkout and anything your integration attached to the session. Where the buyer came from is not part of that unless you put it there.

Your analytics tool sees the visit on your site. Stripe sees the payment on its domain. Without a shared identifier, you are left matching timestamps by hand, which stops working as soon as two campaigns run in the same week. Conversion tracking is the step that hands the visit's identity to Stripe, so the payment can be credited to its source.

The field that carries the click: client_reference_id

Stripe describes client_reference_id on a Checkout Session as a string that "can be used to reconcile the Session with your internal systems." It is the natural place to put a click identifier, and Stripe accepts it from a Payment Link URL, from the pricing table and from your own code.

Stripe's documentation sets two rules for the value:

  • It can contain only letters, digits, dashes and underscores, up to 200 characters.
  • Invalid values are "silently dropped." The payment page keeps working, so you won't see an error. You just get a payment with no source.

An email address or a URL has characters outside that set, so Stripe drops it. CodeQR writes the click as codeqr_id_<click id>, which stays inside both rules.

Setup 1: a short link or QR code that opens a Stripe Payment Link

This is the simplest case, and the one that fits print: a QR code on a flyer, a menu or packaging, or a short link in an email, a bio or a video description, pointing straight at a buy.stripe.com Payment Link.

  1. Connect Stripe under Settings → Integrations in CodeQR. You add the webhook address CodeQR shows you in your Stripe Dashboard, select the events and paste the signing secret back into CodeQR.
  2. Create a short link or a dynamic QR code with your Payment Link as the destination.
  3. Turn on Conversion tracking for that link or code.

On every click or scan, CodeQR adds client_reference_id=codeqr_id_<click id> to the Stripe URL during the redirect. There is no script to install and no code on your side. When the payment completes, Stripe notifies CodeQR and the sale is credited to that click.

Because the credit goes to the link or code, give each source its own: one QR code per store or event, one link per newsletter, one per creator you pay. Their names then answer "which campaign sold?" without extra reporting.

Static QR codes can't do this. Their content is fixed in the image and the scan never passes through CodeQR, so there is no click to record. Use a dynamic QR code.

Setup 2: a checkout button on your own website

When buyers land on your site first and pay later, the click has to survive the visit. CodeQR's script on your site keeps the click identifier in a first-party cookie called cq_id. To hand it to Stripe, add the parameter codeqr_client_reference_id=1 to the Stripe checkout link on your page.

When the visitor selects it, CodeQR replaces that parameter with Stripe's client_reference_id, carrying the click id into the session. Attribute Stripe payments to the right link walks through the setup, and Set up conversion tracking on your website covers the script.

Setup 3: Checkout Sessions you create in code

If your server creates the Checkout Session, set the field yourself when you create it: client_reference_id is codeqr_id_ followed by the value of the cq_id cookie from the buyer's browser.

Nothing else changes. The same webhook reports the completed checkout, and CodeQR reads the field. The CodeQR docs and the help article both show the session code.

What about Stripe's pricing table?

Stripe's embeddable pricing table has its own attribute for this. According to Stripe's pricing table documentation, when you set client-reference-id on the <stripe-pricing-table> element, "the pricing table passes it to the Checkout Session's client_reference_id attribute," with the same character rules.

So the pricing table works like Setup 3. When you render the table, set client-reference-id to codeqr_id_ followed by the value of the cq_id cookie. This takes a small piece of your own code; CodeQR does not fill in the attribute for you.

What about UTM parameters on Payment Links?

Stripe Payment Links accept utm_source, utm_medium, utm_campaign, utm_term and utm_content in the URL. Stripe's documentation sets two conditions: the Payment Link has to use a redirect as its confirmation behavior, and then "your redirect URL contains the UTM code parameters specified in your payment link URL." Values are limited to letters, digits, dashes and underscores, up to 150 characters.

In other words, the UTMs reach your thank-you page, where your analytics tool can read them. The documentation doesn't describe a revenue-by-campaign report built from them in Stripe.

In CodeQR, sales are reported per link and QR code, not per UTM value. That is one more reason to give each campaign its own link: the link becomes the campaign label that sales are counted against.

What CodeQR records when the payment completes

The sale is credited to the link or code that started it. Each link and QR code shows its sales count and sale amount next to its clicks or scans, and Analytics shows leads and sales alongside them. See which links and QR codes generate sales explains the views.

Revenue is reported in US dollars. CodeQR converts each sale from the currency Stripe reports, so a campaign that sells in euros and one that sells in pounds add up in one total, and it keeps the original amount and currency with the sale. On Business and above, Customers also shows each buyer with a timeline from the first click to the purchase.

Attribution uses a 30-day window from the click. How CodeQR decides which click gets the sale explains which click keeps the credit when one buyer clicked several of your links.

Conversion tracking is available on Pro and above. Workspaces on Free and Starter can try it once with a 14-day conversion tracking trial.

What this setup does not count

CodeQR records the checkout that starts a purchase: a one-time payment, or the first payment of a subscription. It doesn't add later subscription renewals as new sales, and it doesn't subtract refunds.

So read the numbers as "which links and codes start purchases," which is what you need to compare campaigns, and keep Stripe as the source for revenue totals.

Send Stripe sales to Meta Ads and TikTok Ads

If your workspace has the Meta Ads or TikTok Ads integration connected, each attributed Stripe sale is also sent to the ad platform as a conversion. Meta receives Purchase for a one-time payment and Subscribe for a new subscription, with the amount in the currency the buyer paid. Send your conversions to Meta Ads covers the connection.

When a payment arrives without a source

Open the Checkout Session in Stripe and look at client_reference_id:

  • If it is empty, the buyer didn't arrive through a link or code with conversion tracking on, or your site removed the codeqr_client_reference_id parameter before the checkout opened.
  • If it has a different shape, CodeQR ignores it. Only codeqr_id_<click id> is read, and values with other characters never reach Stripe at all.
  • If the payment came more than 30 days after the click, it falls outside the window.

Fix conversions that are not being recorded goes through each case.

A short checklist before you launch

  • One link or dynamic QR code per source you want to compare.
  • Conversion tracking on for each of them.
  • Stripe connected in CodeQR, with the webhook added in your Stripe Dashboard.
  • On your own site: the CodeQR script installed and codeqr_client_reference_id=1 on the checkout links.
  • One small real payment through the full path, then check that the sale appears on the right link.

Stripe conversion tracking questions

Stripe stores what you pass into the checkout, such as client_reference_id or metadata. To tie a payment to a campaign, you pass an identifier for the visit into that field and read it back when Stripe reports the completed checkout. Conversion tracking tools such as CodeQR do this for you.

See which links and QR codes sell

Create short links and dynamic QR codes, connect Stripe, and see the sales each one brings in, next to its clicks and scans.