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

Framer analytics revenue: track Stripe payment link sales

By Devendra Variya, co-founder of Virling. Published 2026-11-19, updated 2026-11-26.

A Framer site with a Buy button usually hands the sale to a hosted checkout, and that checkout has no idea which post, search or ad sent the buyer. Virling closes the gap with one script tag in Framer's custom code. The tag gives each visitor an ID and writes it onto your Stripe, Polar, Dodo or LemonSqueezy checkout links, so when the payment comes back from the provider it lands on the visit that led to it. Why hosted checkouts lose the source in the first place is covered in Stripe Payment Link UTM tracking; this post is about the Framer side.

Where the script goes in Framer

Open Site settings, General and scroll to Custom code. Framer offers four slots: start of <head>, end of <head>, start of <body> and end of <body>. Use End of <head> tag. The tag has defer, so it never holds up the page, and start or end of body work too if another tool already fills the head slot. Copy the tag for your site from the Virling app; it looks like this:

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

Two settings sit next to the code box. Keep it on all pages rather than selected pages, since a buyer can enter on any page. When Framer asks how often to run it, pick Once: the script follows page changes by itself, and a second copy loaded per page would log the same page twice (Framer's custom code article calls the menu Project Settings). Then publish. The canvas and preview never run custom code, so nothing shows in Virling until the live site has the tag. The framework setup docs have the same steps.

Page transitions and CMS pages

Framer swaps pages in the browser instead of loading a new document, often with a page transition. The script watches the browser history, so every page a visitor reaches counts as one page view in the same visit, with the original referrer and UTM tags kept. A checkout button on a page reached that way is still tagged: links are tagged once on the first load and again at the moment of the click, which covers anything Framer drew later.

CMS collection pages use the site-wide custom code like any other page, so there is nothing to add per collection. If each CMS item has its own checkout, store the Payment Link in a Link field and bind the button's link to it; the script treats a bound link the same as a typed one.

Worked example: a Framer button to a Stripe Payment Link

  1. In Stripe, create a Payment Link for your product and copy it, for example https://buy.stripe.com/abc123.
  2. In Framer, select your Buy button, open its Link setting and paste that URL. Add no parameters. Opening it in a new tab is fine.
  3. Publish. A visitor arrives from yourdomain.com/?utm_source=newsletter. The script records the visit under a new visitor ID and stores it in the first-party virling_vid cookie.
  4. On the published page the button's address now reads https://buy.stripe.com/abc123?client_reference_id= followed by that ID. If the link already had a client_reference_id, the script leaves it alone.
  5. The visitor pays. Stripe keeps the ID on the Checkout Session. Virling imports the charge from your Stripe account, finds its Checkout Session, reads the ID and credits the sale to newsletter under your attribution model: last non-direct by default, or first touch or last touch.

To connect Stripe, add a restricted key with Read access under Payment connections in site settings. Polar, Dodo and LemonSqueezy links work the same way with their own field; setup for each is on the integrations page.

Start free trial

Which Framer checkouts get a channel

Checkout on your Framer siteRevenueChannel
A Framer button or text link to buy.stripe.com, buy.polar.sh, checkout.dodopayments.com or lemonsqueezy.comImported from the connected providerYes, when the buyer clicked from your published site
Stripe Buy Button or another checkout widget in an Embed componentImported, if that provider is connectedNo. The widget is not a link the script can tag, so the sale is Unattributed
A plugin from the Framer MarketplaceOnly if it charges through a connected providerOnly if it renders a plain link to one of the hosts above; its own cart or form carries no visitor ID

Every Buy Button is built on a Payment Link, so the quick fix for an Unattributed widget is to put that Payment Link on a regular Framer button.

Test it on the live site

  1. Wait for Framer to finish publishing, then open https://yourdomain.com/?utm_source=test&utm_medium=test in a private window.
  2. In Virling, the visitor appears under Visitors and test on the Channels card. No visit means the tag is missing from Custom code or you opened the framer.app address.
  3. Use your menu to go to a second page. The visit should list both pages, once each. A page listed twice means the code runs on every page visit instead of Once.
  4. Click your Buy button and pay. For Stripe, connect a test restricted key (rk_test_) and use a test Payment Link. Test links on Polar sandbox and Dodo Payments do not carry the ID, so make one small live purchase there and refund it.
  5. After about a minute, open /app/yourdomain.com/payments. The payment should say test, and its Visitor under Details leads back to your visit.

More checks are in test your setup, and the no-code guide covers the other builders.

Why a Framer sale shows as Unattributed

  • The click came from outside the site. A Payment Link shared in an email, a social post or a QR code skips your Framer pages, so it never gets an ID. Point those at a Framer page instead.
  • The test ran on framer.app. Framer gives every project, and its staging, a framer.app address. Virling records only the domain in data-site, so connect your own domain; Framer's pricing page lists custom domains on paid plans, and its domain guide allows up to 48 hours for DNS.
  • The change was never published. Edits to custom code reach visitors only after you publish.
  • The tag runs on selected pages only. A buyer who lands on a page without it has no ID to carry.
  • The checkout lives on your own domain or opens from JavaScript. Only the four provider hosts are tagged. For anything else, read the ID from window.virling.vid() and pass it yourself.
  • Cookieless mode is on. data-cookieless drops the visitor ID, so new sales cannot be joined to a visit.

Other builders: Webflow revenue tracking and Carrd revenue tracking.

Frequently asked questions

Can Framer analytics show revenue?

Not on their own. Framer sees the visit, but the payment happens on the checkout provider's page. Virling joins the two by putting a visitor ID on your checkout links and reading it back from each payment, so revenue shows by channel.

Where do I paste the Virling script in Framer?

Site settings, General, Custom code, in the End of head slot, on all pages, set to run Once. Start or end of body also works. Publish afterwards, because the editor preview does not run custom code.

Does tracking survive Framer page transitions?

Yes. Framer changes pages without a reload, and the script counts each new page in the same visit. Checkout links on those pages are tagged when they are clicked.

Do Framer CMS pages need their own setup?

No. CMS collection pages use the site-wide custom code. A button bound to a Link field that holds a checkout link is tagged like any other link.

What does the Stripe link look like after the script runs?

The script adds client_reference_id with the visitor ID to every buy.stripe.com link, unless the link already has one. Stripe keeps it on the Checkout Session, where Virling reads it.

Why is my Framer sale Unattributed?

The buyer usually opened the checkout link from an email, a post or a QR code, or the test ran on the framer.app address or before publishing. Embedded checkout widgets, custom checkout domains and cookieless mode also leave the sale without a channel.

See which channels bring revenue to your Framer site

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