Integration Guides

Strapi

Add Rybbit analytics to your Strapi site

Strapi is a headless CMS: it exposes your content over a REST or GraphQL API and does not render your website. The tracking snippet therefore goes into the frontend that consumes the Strapi API, not into Strapi.

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 Strapi

Strapi has no template or head setting to paste into. Add the snippet to the <head> of the frontend application that fetches content from Strapi.

Next.js is the most common Strapi frontend. Add the snippet with next/script in your root layout so it loads on every route. Follow the Next.js guide.

Nuxt is a popular Strapi frontend. Add the snippet under app.head.script in nuxt.config.ts. Follow the Nuxt guide.

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

  • The admin panel is not tracked: the Strapi admin at /admin is served by the Strapi server, not by your frontend, so it never loads the snippet. Content editors' activity does not appear in Rybbit, which is usually what you want.

Next steps

On this page