Install

Add analytics and revenue attribution to Framer

Framer sites are single-page applications behind the scenes, which is exactly the case that trips up analytics tools installed by hand. This one handles it, but it's worth understanding why before you check your numbers.

Start a 14-day trialLast reviewed August 2026
  1. Paste the snippet into Custom Code

    Open Site Settings → General → Custom Code and paste the tag into the 'Start of <head> tag' field, then publish. Custom code runs on the published site only.

    Site Settings → General → Custom Code
    <script defer src="https://revtrail.pyln.dev/track.js" data-site="SITE_KEY"></script>
  2. Understand why page navigation still counts

    Framer navigates between pages client-side rather than loading a new document. A naive script would report only the landing page and nothing after it. Ours watches the History API, so each Framer page transition reports its own pageview — which is what makes per-page reporting meaningful on a Framer site at all.

  3. Confirm it's receiving

    Open your site in a normal browser tab, then check Realtime in the Revtrail dashboard — your own visit should appear within a few seconds. If nothing arrives, the usual causes are a mistyped site key, an ad blocker on your own browser, or a Content-Security-Policy that blocks the script origin.

  4. Attribute what the site is for

    Most Framer sites exist to produce one action: a booking, a waitlist signup, a purchase on another domain. Fire revtrail('signup') from a code component or an embed on the success state, and the channel that brought that visitor gets the credit. If the purchase completes on a different domain, carry the visitor id across with the rt_vid parameter so the journey doesn't break.

CMS collection pages

Every CMS page is its own URL, so blog posts and case studies show up individually in top pages with no extra configuration. That's the report that tells you which piece of content actually brings people who convert, rather than which one gets the most drive-by traffic.

The cross-domain case

Framer marketing site, app on another domain, checkout somewhere else again — a common shape, and the one that breaks attribution silently. Decorate links to your app with the visitor id (rt_vid) and the app adopts it, so the payment attributes back to the campaign that produced the first visit instead of showing up as direct.

Framer's own analytics

Framer includes basic analytics on paid plans. It answers 'how many people visited'. It doesn't connect a visitor to a payment or rank channels by revenue, which is a different job rather than a missing feature.

Questions people actually ask

Does the script work with Framer's page transitions?
Yes. Transitions go through the History API and each one reports a pageview for the new path.
Can I fire custom events from a Framer code component?
Yes — window.revtrail?.('signup') from any code component or embed, once the site is published.
Do I need a cookie banner for this?
Not for Revtrail. The default identity is a daily rotating hash — no cookies, no persistent identifier, nothing stored on the device. If you run ad pixels or other analytics that do use cookies, their obligations are unchanged.
Will this slow my site down?
The script is deferred, so it never blocks rendering, and it's about 3KB over the wire gzipped. It fires one beacon per pageview.

Install guides

All install guides