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

Bubble revenue tracking: see which channel brings each payment

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

To see which channel brought each payment in a Bubble app, every Stripe payment needs an ID that points back to the visit. A Bubble app sends users to Stripe to pay, and Stripe never sees the UTM tags or the referrer of the visit that led there. Add the Virling script in Bubble's SEO / metatags settings, send users to a Stripe Payment Link or a Checkout Session that carries the visitor ID, and connect Stripe. Each payment then shows the post, search or ad that brought the paying user.

Start free trial

Why a Bubble app loses the source at checkout

A visitor lands on your Bubble app from a search, a post or a launch thread, signs up, and later pays on a Stripe page. The visit and its source stay in your app; the payment happens at Stripe. Your analytics can see the visit but not the payment, and Stripe sees the payment but not where the visit came from. On a Stripe Payment Link, for example, the UTM tags on your page are dropped and the Checkout Session has no field for the referrer.

What joins the two is one ID that Stripe keeps and hands back with the payment. Virling reads it from the Checkout Session's client_reference_id or metadata.virling_vid, or from metadata.virling_vid on the PaymentIntent or charge. Bubble's own Stripe plugin, with actions such as Charge the current user and Subscribe the user to a plan, has no setting for either field in Bubble's manual, so payments it makes carry no visitor ID. Two ways do carry it:

  • Stripe Payment Links: a plain buy.stripe.com link on a page that runs the script gets client_reference_id with no code.
  • Stripe Checkout Sessions: a session you create through the API Connector takes the visitor ID as client_reference_id.

Set up revenue tracking in a Bubble app

Step 1: add the script in SEO / metatags. In the Bubble editor, open the Settings tab, then SEO / metatags. Paste the tag into Script/meta tags in header, and Bubble adds it to the <head> of every page of the app. The app shows the exact tag for your site:

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

Deploy the app to live and check the live app. The script records the referrer and UTM tags of every visit against a visitor ID in the first-party virling_vid cookie. Every step is in the framework setup docs.

Step 2a: sell with a Stripe Payment Link. Add a Link element, set Link destination to External URL, and put your Payment Link, such as https://buy.stripe.com/abc123, in Destination URL. Nothing else goes on the link. A Link element is a normal link, so the script adds client_reference_id with the visitor ID when the page loads and again on click, and never replaces one that is already there. A Button with an Open an external website action opens the URL from a workflow instead of a link, so it is not tagged. For what a Payment Link keeps and drops, see Stripe Payment Link UTM tracking.

Step 2b: or create a Checkout Session. If your app creates Checkout Sessions through the API Connector, add client_reference_id to the POST /v1/checkout/sessions call, as a parameter whose value the workflow fills in. The value comes from the browser: window.virling.vid() returns it once the script has loaded. API Connector calls run on Bubble's server and Bubble's built-in actions do not run your own JavaScript, so use a plugin that runs JavaScript in the page and hands the result to the workflow. Then send the user to the session's url with Open an external website. If you already use client_reference_id for something else, send metadata[virling_vid] instead. The limits of the field are in Stripe client_reference_id. The checkout snippet generator shows the Stripe code, and Link checkout to visits covers every option.

Step 3: connect Stripe. In Virling, add Stripe under Payment connections in site settings with a restricted key that has Read access. Virling reads the visitor ID from each payment and credits it to the visit, under the attribution model you pick: last non-direct by default, or first touch or last touch. The setup is on the Stripe integration page.

Step 4: make a test payment. Follow the five steps under Check your Bubble app after deploying below. The UTM builder makes tagged links for your real campaigns.

Ways to take payments in Bubble, and what can be linked

The same Stripe account can give a linked payment or an Unattributed one, depending on how the app opens checkout:

How you take paymentsCan the visitor be linked?Needs a settingNot supported
Payment Link or other hosted checkout link on a Link elementYes, for links on buy.stripe.com, buy.polar.sh, checkout.dodopayments.com and lemonsqueezy.com. Bubble renders a Link element as an <a> tagThe script in SEO / metatags, and External URL as the link destinationLinks on a custom checkout domain, and links opened outside your app
Payment Link opened by a workflow with Open an external websiteNot by itself. There is no link on the page to tagA dynamic URL with the visitor ID as client_reference_id, or a Link element insteadThe channel, when the URL has no visitor ID
Stripe Checkout Session through the API ConnectorYesclient_reference_id or metadata[virling_vid] in the call, filled from window.virling.vid() in the pageSessions created without it, and calls that run with no visitor in the browser
Bubble's Stripe plugin: Charge the current user, Subscribe the user to a planNot by visitor ID. The manual lists no field for itOptional: send the user's email with your own script to match by emailLinking by visitor ID. Charges in the Stripe account you connect still count as revenue, as Unattributed unless the email matches
Bubble's Braintree pluginNoNoneBraintree is not a provider Virling connects to, so these payments are not imported

If an app uses more than one of these, only the payments from the linked rows show their channel. The rest of the Stripe payments are still in your total.

Check your Bubble app after deploying

  1. Deploy the app to live, so the header code is on the live version and not only on /version-test/.
  2. Open https://yourdomain.com/?utm_source=test&utm_medium=test in a private window, with the domain you put in data-site and without /version-test/.
  3. Open your Virling dashboard. The visit shows under Visitors right away, and test shows on the Channels card. If it is missing, check that the tag is in Script/meta tags in header and deploy again.
  4. In the same private window, go to checkout. With a Link element, copy the link address first: it has client_reference_id= and an ID in it. Then pay. Connect a restricted key that starts with rk_test_ and use a test Payment Link, or a Checkout Session created with a test key, and one of Stripe's test cards. If your live app has only live keys, make one small live payment and refund it.
  5. Wait a minute, then open /app/yourdomain.com/payments. The payment shows test instead of Unattributed. Open it: Visitor under Details has an ID, and the journey starts at your test visit.

Test payments stay in your reports after you switch to a live key. If your app sets customer on the session, use a new customer for each test, since a later payment by the same customer keeps the channel of the first one. If a step fails, see test your setup. The same setup for other site builders is in the no-code guide.

When a Bubble payment has no source

  • The payment came from the Stripe plugin. Its actions set neither client_reference_id nor metadata.virling_vid. Use a Payment Link or an API Connector session for checkout.
  • The checkout opened from a workflow. A Payment Link opened with Open an external website is not a link, so it is not tagged. Use a Link element.
  • The link was opened off your app. Payment Links in emails, social posts or QR codes never pass through a page with the script, so they carry no visitor ID. Send people to your app and let them click through from there.
  • The session was created without the ID. If the plugin that runs JavaScript returned nothing, for example because the script was blocked, the session has no visitor ID.
  • Cookieless mode. With data-cookieless there is no visitor ID to pass, so new payments are Unattributed.

For the full picture of Stripe attribution outside Bubble, see how to track Stripe revenue by traffic source.

Building on another site builder? See Webflow revenue tracking and WordPress revenue tracking.

Frequently asked questions

Can Bubble show which channel brought a payment?

Not by itself. A Bubble app sends users to Stripe to pay, and Stripe never sees the referrer or UTM tags of the visit. With the Virling script added in SEO / metatags, Stripe Payment Links and Checkout Sessions carry a visitor ID, and Virling joins each payment to the visit and its channel.

Does Bubble's Stripe plugin pass the visitor ID?

No. Bubble's Stripe plugin has no setting for client_reference_id or metadata, so its payments carry no visitor ID and show as Unattributed. Sell through a Stripe Payment Link on a Link element, or create a Checkout Session with the API Connector and pass the ID as client_reference_id.

Do I need code to track Stripe Payment Links in Bubble?

No code beyond the script. Paste it into Script/meta tags in header and deploy to live. The script adds client_reference_id with the visitor ID to every buy.stripe.com link on the page, as long as the link is a Link element and not a workflow action, and Virling reads it from the Checkout Session.

Can I use metadata instead of client_reference_id?

Yes. If your Checkout Session already uses client_reference_id, set metadata[virling_vid] to the visitor ID instead. Virling reads metadata.virling_vid on the Checkout Session, the PaymentIntent or the charge.

Why does my Bubble payment show as Unattributed?

The payment carried no visitor ID: it came from the Stripe plugin, from a Payment Link opened with a workflow action instead of a Link element, or from a link opened off your app, such as in an email. It also happens when a Checkout Session was created without the ID, or in cookieless mode.

Do payments from Bubble's Stripe plugin still count as revenue?

Yes, when the charge is in the Stripe account you connect to Virling. It has no visitor ID, so it shows as Unattributed, unless your app sent the user's email in an identify event before the payment was synced and it matches the billing or receipt email in Stripe.

See which channels bring revenue to your Bubble app

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