Analytics for Webflow: Step-by-Step Setup
Webflow has a built-in way to add custom code to your site's <head>. No code editor, no plugin, no developer needed.
Adding the tracking snippet in Webflow
- Open your Webflow project in the Designer.
- Click the Project Settings gear icon (or go to Settings from the Webflow dashboard).
- Go to the Custom Code tab.
- In the Head Code section, paste your Antlytics tracking snippet.
- Click Save Changes.
- Publish your site for the changes to go live.
Your tracking snippet (from your Antlytics dashboard under Settings → Tracking Snippet):
<script>
(function(){
var t="YOUR_TRACKING_ID",
u="https://www.antlytics.com/api/ingest/pageview",
k="ant_sid";
function sid(){
try{var s=sessionStorage.getItem(k);if(s)return s;
s=crypto.randomUUID();sessionStorage.setItem(k,s);return s;}
catch(e){return crypto.randomUUID();}
}
function send(){
fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},
keepalive:true,body:JSON.stringify({tracking_id:t,
pathname:location.pathname,referrer:document.referrer||undefined,
session_id:sid()})}).catch(function(){});
}
send();
window.addEventListener("popstate",send);
})();
</script>
Replace YOUR_TRACKING_ID with your actual UUID from the Antlytics dashboard.
Verifying it works
- Visit your published Webflow site (not the Designer preview — the Designer does not execute custom code the same way).
- Open browser dev tools → Network tab.
- Navigate to a page and look for a POST request to
api/ingest/pageview. - Check your Antlytics dashboard for a new visitor.
Important: Test on the published site, not in the Webflow Designer preview. Custom code in the head may not execute correctly in the Designer environment.
Custom domain considerations
If you use a custom domain with Webflow, the tracking snippet works the same way. The script sends requests to www.antlytics.com regardless of your site's domain.
If you want to use the first-party proxy (to route analytics through your own domain), you need a server-side component — which Webflow does not support directly. For Webflow sites, the script tag approach is the standard method.
Goals on Webflow
Conversion goals work with Webflow. Set up a goal in your Antlytics dashboard for the pathname of your success page:
- Newsletter signup → set your form "success" redirect to a specific page like
/subscribe/success - Contact form submission → redirect to
/contact/thanks - Any form completion → create a dedicated confirmation page
Configure that pathname as a goal in your Antlytics dashboard under Settings → Goals.
FAQ
Does this work on the Webflow free plan? Yes. Custom code in Project Settings is available on all Webflow plans that support custom domains (check your Webflow plan for current limits).
Can I add different tracking for different pages? Using Webflow's Page Settings (individual page custom code), you can add page-specific code. For site-wide tracking, Project Settings → Head Code is the right place.
What if I'm using Webflow CMS? The site-wide head code applies to all CMS pages automatically. You do not need to add tracking to each CMS template separately.
Related: Webflow docs · Antlytics implementation guides · Conversion goals without cookies