Website builders · 3 min setup
How to add analytics to a Bubble app
data-exclude="/version-test*" so your development version doesn't count as real traffic.Updated
Bubble applies header scripts on paid plans. Bubble serves your development version under /version-test on the same domain as Live, which is easy to forget: without the exclusion, every test run of a workflow shows up in your analytics.
Bubble at a glance
- Where the tag goes
- Settings → SEO / metatags → Script/meta tags in header
- Plan needed
- A paid Bubble plan for custom header scripts
- Dev version
- Exclude with
data-exclude="/version-test*" - Events
- Workflow → Run javascript (Toolbox plugin)
- Goes live
- After Deploy to Live
How to install VisitTrack on Bubble
Step 1: Copy your site id
Add your app's domain as a site in VisitTrack and copy the snippet from the install step. Replace
SITE_IDbelow.Step 2: Open Settings → SEO / metatags
In the Bubble editor, open Settings → SEO / metatags and scroll to Script/meta tags in header.
Step 3: Paste the tag with the version-test exclusion
data-excludetakes comma-separated paths with*as a wildcard, and is checked on every event — so nothing from the development version is sent.Script/meta tags in header<script defer data-site="SITE_ID" data-exclude="/version-test*" src="https://visitrack.app/tracker.js"></script>Step 4: Deploy to Live
Deploy the app to Live, then open the live URL (not
/version-test) and use it for a minute.
How to check VisitTrack is working on Bubble
- Open the Live app and visit two pages.
- VisitTrack's live view shows you within seconds; the Pages tab lists both pages.
- Open
/version-testtoo and confirm it doesn't appear — withdata-debugon the tag, the console logsignoredfor those events.
Does VisitTrack track Bubble page navigation?
Each Bubble page (/index, /dashboard, /settings) is counted by its path. Bubble apps often switch "tabs" on one page by changing URL parameters (/dashboard?tab=billing) — the path stays the same, so those aren't separate pageviews.
If those in-page screens matter, fire a custom event when you show them (below) — screen_view with a screen prop works well — and build a funnel from it.
How to track custom events and goals in Bubble
Install the free Toolbox plugin to get a Run javascript action, then add it to a workflow right after the step that matters — for example after Sign the user up. Bubble lets you insert dynamic data into the code with the expression editor, such as the current user's unique id.
To tie visits to accounts, call identify in the same workflow; the person then appears in VisitTrack's People tab with their traits.
// Workflow: Sign the user up → Run javascript
window.visitrack && window.visitrack("signup", { plan: "free" });
// Optional, same workflow: link this visitor to the Bubble user
window.visitrack && window.visitrack.identify("Current User's unique id", { plan: "free" });For a click-only event, an HTML element containing <a href="/pricing" data-vt-goal="pricing_click"> works too. Then make the event a goal in Settings → Goals. Replace the quoted user id above with Bubble's dynamic expression.
Revenue attribution on Bubble
Revenue attribution needs the visitor id on the payment. If you charge with Stripe Payment Links, the Stripe guide's Payment Link snippet adds it automatically — paste it into the header field after the tracker. If you create Stripe Checkout Sessions through the API Connector, pass the visitor id (read with window.visitrack.visitorId() in a Toolbox "JavaScript to Bubble" element) as client_reference_id.
Script options you might need on Bubble
All optional — add them to the same tag. Full reference: script configuration.
| Attribute | What it does |
|---|---|
data-cookieless | Store nothing in the browser; the server derives a daily-rotating id. See cookieless mode. |
data-exclude="/app/*" | Never track these paths (comma-separated, * wildcard). Checked on every navigation. |
data-allow-local | Track on localhost and *.local — for testing an install only. |
data-debug | Log every event the script sends, and why it skipped one, to the console. |
data-auto="false" | Turn off automatic events (downloads, contact clicks, form submits, rage clicks, JS errors, 404s). |
Bubble troubleshooting
Development traffic in your stats
Add data-exclude="/version-test*" to the tag and redeploy, or save only your live domain under Allowed hostnames.
The header field has no effect
Custom header scripts need a paid plan, and changes reach Live only after you deploy.
Run javascript does nothing
The action must run in the browser (a page workflow, not a backend workflow). Backend workflows can call POST /api/track through the API Connector instead — see server-side events.
Events have the literal text of the expression
Insert the value with Bubble's dynamic expression editor inside the quotes, and check the Toolbox action's code preview.
Bubble analytics FAQ
Where do I add a script tag in Bubble?
Settings → SEO / metatags → Script/meta tags in header. It's output in the head of every page of your app on a paid plan after you deploy to Live.
How do I stop Bubble's version-test from being tracked?
Add data-exclude="/version-test*" to the script tag. The tracker checks excluded paths on every event and sends nothing for them.
Can I track Bubble workflows as conversions?
Yes. Add a Toolbox Run javascript action to the workflow and call window.visitrack("event_name"). Then turn the event into a goal or a funnel step in VisitTrack.
Can VisitTrack identify Bubble users?
Yes. Call window.visitrack.identify with the user's unique id and traits from a Run javascript action after login or signup. See People & identify.
Do I need a cookie banner with VisitTrack on Bubble?
Not in cookieless mode, which stores nothing in the browser. General information, not legal advice.
Keep going
- Webflow analyticsAdd VisitTrack to Webflow in Site settings → Custom code → Head code, then publish — plus custom attributes for goals and Stripe Payment Link revenue.
- Carrd analyticsAdd VisitTrack to a Carrd site with a hidden Embed element placed in the head (Pro Standard and up) — plus outbound clicks and Stripe Payment Links revenue.
- Framer analyticsAdd VisitTrack to Framer in Site Settings → General → Custom Code (End of <head> tag) — Framer's client-side page changes are tracked automatically.
- Google Tag Manager analyticsLoad VisitTrack from Google Tag Manager with a Custom HTML tag on All Pages — SPA-safe, consent-aware, with dataLayer events forwarded as custom events.
- Install the tracking scriptThe reference tag, CSP notes and how to check it's working.
- Custom events and signupsvisitrack(), data-vt-goal, scroll events and server-side signups.
- Use casesHow SaaS teams, indie hackers, stores and agencies use VisitTrack.
- VisitTrack vs Google AnalyticsCookie-free analytics with revenue attribution, compared honestly.
Add VisitTrack to your Bubble site
Cookie-free analytics with revenue attribution, live visitors, funnels and session replays. One script tag, every feature on every plan. 14 days free, no card required.
Not on Bubble? See all 29 integration guides.