Analytics after moving off Framer

What happens to analytics when you move a Framer site to code, where tracking snippets end up, and how to set up GA4, Plausible or PostHog.

Published
Reading time
5 min
Deframer cover: “Keep counting after the move.” Beside it, a list of Framer stats, GA4, Custom code and Your analytics with Your analytics selected
On this page8 sections

When you move a Framer site to code, Framer's built-in analytics stays behind: its dashboard and history belong to your Framer project, not to the published files. Any third-party tracking you added through Framer's custom code, such as Google Analytics, Plausible, Fathom or PostHog, comes along in a Deframer conversion, placed where Framer ran it, so it keeps recording from the first day on the new host. Before you switch, export or note the Framer numbers you care about, confirm your own tool records visits on a preview deployment, and decide whether to keep the snippet or move to a cleaner setup in code.

This guide covers each of those steps and gives examples for the most common tools. Deframer is an independent tool and is not affiliated with, endorsed or sponsored by Framer.

What happens to each kind of analytics?

Analytics source

After converting with Deframer

Framer's built-in analytics

Stays in Framer; stops receiving data once traffic goes to the new host

Snippets in Framer's site custom code

Carried into the root layout, running before hydration as on Framer

Snippets in a page's custom code

Carried into that page's route

Tag managers (Google Tag Manager)

Carried over with the custom code, with the tags inside it

Analytics components from Framer's marketplace

Come across as source in src/vendor, like other marketplace components

Search Console HTML verification tag

Carried over with the custom code; DNS verification doesn't depend on the host

The converter places site-level custom code where Framer ran it: head code at the start of the body, before any content, and body code at the start or end. Scripts run as the browser parses the page, before the site hydrates, which is what tag loaders such as Google Tag Manager expect.

Step 1: save what Framer's analytics knows

Before you move the domain, open Framer's analytics for the project and record what you need for comparisons later: monthly visitors, top pages, top referrers, and any conversion numbers. Framer's analytics isn't exported with the site, and its data stops growing when visitors reach the new host.

If you already run a third-party tool alongside Framer's, you have a continuous record and this step is only a cross-check.

Step 2: check the carried-over snippet works

Deploy the converted project to a preview URL on your host, then:

  1. Open the preview in a browser with ad and tracker blocking turned off.
  2. Watch your analytics tool's real-time or live view while you click around.
  3. In the browser's network panel, confirm the tracking requests go out and return successfully.

If nothing arrives, the usual causes are:

  • The tool filters by domain. Plausible, Fathom and others count only domains you've registered. A preview URL won't record until the production domain serves the site, or until you add the preview domain.
  • Content Security Policy. If you added security headers on the new host, allow the tool's script and endpoint. See security headers for a self-hosted Framer site.
  • Consent. A consent banner that blocks tracking until a visitor accepts will, correctly, block your test visit too. Accept and try again.

Search the project to see where the snippet landed:

sh
grep -rn "googletagmanager\|plausible\|posthog\|fathom" src | head

Step 3: decide whether to move it into code

The carried-over snippet works, so there's no rush. Moving it into code is worth it when you want type-safe custom events, consent handling in one place, or a script that loads with a lower priority.

Google Analytics 4

Next.js has an official helper package, @next/third-parties, with a GoogleAnalytics component you add to the root layout:

tsx
// src/app/layout.tsx
import { GoogleAnalytics } from "@next/third-parties/google";

// inside <html>, after <body>…</body>:
<GoogleAnalytics gaId="G-XXXXXXXXXX" />

Check the package's documentation for the current API, then remove the old snippet from the layout so you don't count every visit twice.

Plausible, Fathom or Umami

These are a single script tag. With next/script:

tsx
import Script from "next/script";

<Script defer data-domain="example.com" src="https://plausible.io/js/script.js" strategy="afterInteractive" />

Use the exact snippet your tool gives you for your account; script URLs differ by plan and by self-hosted setups.

PostHog

PostHog has a JavaScript library you initialize once in a client component, which also gives you feature flags and experiments. Follow PostHog's Next.js guide for the current setup, which typically involves a provider component in the root layout and an environment variable for the project key.

Other frameworks

In TanStack Start, Astro, React Router and Vite projects, the site's own head tags live in the document or src/site/head.ts (Astro and React Router), and custom code is carried over there in the same way. Add a script tag in the document, or initialize a library in a client entry, as each tool's docs describe for that framework.

Step 4: track conversions you used to get from Framer

If you relied on Framer's analytics for form submissions or clicks, set those up as events in your tool:

  • Forms. Native Framer forms post to the project's own API route in Next.js, TanStack Start, Astro and React Router. You can send an event from the browser on success, or count submissions on the server where the route delivers them to your webhook. The forms guide covers the routes.
  • Clicks on key buttons. Add an event in the component's click handler, or use your tool's autocapture.
  • Split tests. If the site ran a Framer A/B test, record each visitor's variant; the split tests guide explains how the converted test assigns them.

Step 5: compare before and after

After the domain moves, compare the first few weeks with the numbers you saved from Framer. Expect differences: tools count visits differently, ad blockers block some tools more than others, and Framer's analytics and a third-party tool rarely agreed exactly even when both ran. Look for big gaps on specific pages, which usually point at a page missing the snippet, rather than small differences overall.

Search Console is the neutral reference for search traffic. It's tied to your domain, not your host, so its history continues unbroken; the SEO migration guide covers what to watch there.

Server logs: analytics you didn't have on Framer

Self-hosting gives you something Framer hosting doesn't: your own request logs. Most hosts show them, and on your own server they're files. They count every request, including visitors who block scripts and crawlers such as search and AI bots. They aren't a replacement for product analytics, but they're a useful check.

FAQ

Does Framer's analytics data come with the conversion?

No. It's stored in your Framer project, not in the published site. Record the numbers you need before you move the domain.

Will my Google Analytics keep working after converting?

If it was added through Framer's custom code, yes: the snippet is carried over and runs where it did on Framer. Check it on a preview deployment before you switch DNS.

Do I need Google Tag Manager in the new site?

Only if you use it. A GTM container from Framer's custom code is carried over with its tags. If you only used it to load one analytics script, adding that script directly is simpler.

Why are my visitor numbers different after the move?

Different tools count differently, and ad blockers affect them unequally. Compare trends and page-level patterns, not exact totals, and check that every page loads the snippet.

Which analytics tool should I use after leaving Framer?

Any tool you'd use on a normal website works: GA4 if you need Google's ecosystem, privacy-focused tools such as Plausible or Fathom for simple, cookie-light counts, or PostHog if you also want product analytics, flags and experiments.

Keep reading

All posts