Integration Guides

Framer

Add Rybbit analytics to your Framer site

Framer has a Custom Code section in the site settings that injects HTML into the <head> of every published page.

Get your tracking snippet

In your Rybbit dashboard, open Site Settings → Tracking Script and copy your snippet. It looks like this:

<script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script>

YOUR_SITE_ID is the numeric ID of your site. If you self-host Rybbit, app.rybbit.io is the domain of your own instance.

Add the snippet to Framer

  1. Open your Framer project and go to Site Settings → General.
  2. Scroll to Custom Code.
  3. Paste the snippet into the Start of <head> tag field (End of <head> works too).
  4. Click Save, then Publish. Custom code only reaches the live site on publish.

Verify installation

Open your live site in a new tab and click through a few pages. Within a few seconds the pageviews appear in the Rybbit dashboard.

If nothing shows up:

  • View the page source and search for script.js?siteId= to confirm the snippet is on the page.
  • Open the browser Network tab and check that script.js returns 200 and that POST requests go to /api/track.
  • Disable ad blockers, or set up a proxy so the script loads from your own domain.
  • See the script troubleshooting guide for other common causes.

Track custom events

Use a Code Override to send events from any element in the canvas.

  1. Select the element, open Overrides in the properties panel, and click + File to create an override file such as RybbitOverrides.tsx.
  2. Add an override that wraps the element's click handler:
// RybbitOverrides.tsx
import type { ComponentType } from "react";

export function withRybbitClick(Component: ComponentType): ComponentType {
  return (props) => {
    const handleClick = () => {
      window.rybbit?.event("cta_click", { label: props.text ?? "cta" });
      props.onClick?.();
    };
    return <Component {...props} onClick={handleClick} />;
  };
}
  1. Back in the properties panel, pick the file and apply withRybbitClick to the element.

The same window.rybbit.event() call works inside a Code Component.

Troubleshooting

  • Navigation between pages is not tracked: Framer sites navigate client-side and the script detects those URL changes. If a view changes without the URL changing, call window.rybbit.pageview() from an override when it appears.

Next steps

On this page