Integration Guides

Replit

Add Rybbit analytics to your Replit app

Replit has no publishing setting for custom head code, so the snippet goes into the app's HTML entry file: ask Agent to add it, or open the file in the workspace and paste it yourself. The change reaches the live URL only after you republish.

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 Replit

Paste this into the Agent chat, with your snippet in place of the placeholder:

Add this script tag to the <head> of the app's HTML entry file so it loads on every page. Keep all existing head tags.
<script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script>

Review the change before you approve it: the tag belongs in the HTML document, not in a React component or server file.

Open the file that owns the <head> from the Files pane of the workspace:

  • Agent-built web apps are typically a Vite + React client with an Express server, and the HTML entry is client/index.html. Some projects keep it at index.html in the project root.
  • Next.js projects use app/layout.tsx with next/script, as in the Next.js guide.
  • Plain HTML projects (Static deployments): add the tag to every page, or to the shared template if you have one.

Paste the snippet before </head>:

client/index.html
<head>
  <meta charset="UTF-8" />
  <title>My app</title>
  <script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script>
</head>

Then click Publish in the upper right (or Republish for an app that is already live) so a new release goes out at the same URL. In-app route changes are tracked as pageviews automatically.

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.

Troubleshooting

  • Live app has no script: changes in the Project Editor do not replace the live release on their own. Test in Preview, then click Republish.
  • Agent rewrote the file: a later request can regenerate client/index.html. Tell Agent to keep the Rybbit script when you ask for layout changes, and re-check the page source after large refactors.
  • Numbers differ from Replit's deployment analytics: Replit counts requests at the server; Rybbit counts browser pageviews after ad blockers and bot filtering, so the two rarely match exactly.

Next steps

On this page