Website builders · 2 min setup

How to add analytics to Webflow

To add VisitTrack to Webflow, paste the script tag into Site settings → Custom code → Head code, save, and publish the site. Webflow injects Head code into every page, so one paste covers static pages, CMS collection pages and localized versions.

Updated

Webflow only outputs custom code on a site with a paid Site plan or in a paid Workspace (Core, Growth, Agency or Freelancer), and only after you publish. Code never runs inside the Designer canvas or its preview — which is also why your design sessions don't show up as visits.

Webflow at a glance

Where the tag goes
Site settings → Custom code → Head code
Plan needed
A paid Site plan or paid Workspace (custom code)
Goes live
Only after Publish (staging and/or custom domain)
Goals without code
Element settings → Custom attributes → data-vt-goal
Forms
Webflow form submits recorded as form_submit automatically

How to install VisitTrack on Webflow

  1. Step 1: Copy your site id

    Add your site in VisitTrack and copy the snippet from the install step (or Settings → General). Replace SITE_ID below.

  2. Step 2: Open Site settings → Custom code

    From the Webflow dashboard, open your site's Site settings (or the gear icon in the Designer) and go to the Custom code tab.

  3. Step 3: Paste the tag into Head code

    Paste it into the Head code box. Head code is output before </head> on every page, so you don't add anything per page.

    Head code
    <script defer data-site="SITE_ID" src="https://visitrack.app/tracker.js"></script>
  4. Step 4: Save, then publish

    Click Save changes, then Publish and pick the domains to publish to. Custom code reaches your live site only on publish — saving alone isn't enough.

How to check VisitTrack is working on Webflow

  1. Open your published domain (not the Designer preview) in a normal browser tab and visit two pages.
  2. VisitTrack's live view shows you within seconds; the Pages tab lists both pages, including CMS item pages like /blog/your-post.
  3. View source on the live page and search for tracker.js — if it's missing, the site wasn't republished after saving.

Webflow sites are multi-page: each page is a full page load, and each load is a pageview. Localized pages (/fr/…) and CMS collection pages each appear under their own path in the Pages tab.

If you publish to both the *.webflow.io staging domain and your custom domain, both will send data. Save your custom domain under Settings → General → Allowed hostnames in VisitTrack to drop staging hits (blocked hosts are listed there for 7 days, so nothing disappears silently).

How to track custom events and goals in Webflow

Webflow lets you add any HTML attribute to an element without code: select a button or link, open Element settings (the gear in the right panel) → Custom attributes → +, and add name data-vt-goal with a value such as demo_click. Every click on it becomes a custom event.

For "did they reach the pricing table?", add a custom attribute data-vt-scroll with value pricing_viewed to the section — it fires once when the section is half visible.

Form submissions are recorded automatically as a form_submit event, named after the form's id or name. For a cleaner conversion, set the form's redirect URL to a thank-you page and create a page goal for that path in VisitTrack's Settings → Goals.

Rendered HTML
<!-- what the custom attribute produces -->
<a href="/demo" class="button" data-vt-goal="demo_click">Book a demo</a>

Revenue attribution on Webflow

Webflow Ecommerce runs checkout on Webflow's own payment integration, which VisitTrack can't read, so those orders aren't attributed. If you sell through Stripe Payment Links (buy.stripe.com buttons on your Webflow site), connect Stripe in VisitTrack's Settings → Revenue and paste this into Footer code — it adds the visitor id to every Payment Link so each payment is credited to the referrer and campaign that brought the buyer. Details: Stripe revenue attribution.

Site settings → Custom code → Footer code
<script>
  document.addEventListener("DOMContentLoaded", () => {
    const visitorId = localStorage.getItem("_ana_vid");
    if (!visitorId) return;
    document.querySelectorAll('a[href^="https://buy.stripe.com/"]').forEach((a) => {
      const url = new URL(a.href);
      url.searchParams.set("client_reference_id", visitorId);
      a.href = url.toString();
    });
  });
</script>

Script options you might need on Webflow

All optional — add them to the same tag. Full reference: script configuration.

AttributeWhat it does
data-cookielessStore 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-localTrack on localhost and *.local — for testing an install only.
data-debugLog 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).

Webflow troubleshooting

The Custom code tab says it requires a plan

Custom code needs a paid Site plan or a paid Workspace plan. Upgrade, then paste and publish again.

Saved, but nothing is tracked

Publish the site. Webflow applies custom code to the live site only when you publish.

Visits from yoursite.webflow.io mixed in

Add your production domain to Allowed hostnames in VisitTrack, or stop publishing to the staging domain.

A custom attribute isn't firing

Check the name is exactly data-vt-goal (Webflow doesn't add the data- prefix for you) and that you republished.

Your own visits inflate the numbers

Open your live site once with ?vt_ignore=1 at the end of the URL; that browser is excluded until you visit with ?vt_ignore=0.

Webflow analytics FAQ

Can I add VisitTrack to Webflow on the free plan?

Not to the whole site. Webflow only outputs site-wide custom code with a paid Site plan or a paid Workspace plan. Once you have one, the install is a single paste into Head code.

Should the VisitTrack script go in Head code or Footer code in Webflow?

Head code. The tag uses defer, so it doesn't block rendering, and loading it early means short visits are still counted.

Does VisitTrack track Webflow CMS pages?

Yes. Every published page, including CMS collection pages and localized pages, uses the site-wide Head code and appears under its own path.

How do I track Webflow button clicks without code?

Add a custom attribute named data-vt-goal to the button in Element settings, with your event name as the value. Then turn that event into a goal in VisitTrack's Settings → Goals.

Do I need a cookie banner on Webflow with VisitTrack?

Not in cookieless mode, which stores nothing in the browser. Add data-cookieless to the tag or switch the site's tracking mode in Settings. General information, not legal advice.

Does VisitTrack replace Webflow Analyze?

It covers different ground: VisitTrack adds revenue attribution, funnels, session replays, AI-crawler tracking and an API on top of traffic analytics. Many teams run both.

Keep going

Add VisitTrack to your Webflow 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.

14-day free trial · No card required · Cookie-free · Cancel anytime

Or explore the live demo first →

Not on Webflow? See all 29 integration guides.