GitBook
Options for using Rybbit Analytics with GitBook documentation
GitBook is a popular platform for creating documentation and knowledge bases.
GitBook no longer supports adding arbitrary custom scripts (JS/HTML) to published sites. The old Custom scripts → Head setting this guide previously described has been removed, so the standard Rybbit <script> snippet cannot be pasted into a GitBook-hosted site. Analytics on GitBook now works through its built-in integrations, and Rybbit does not currently have a prebuilt GitBook integration.
Current options
Build a custom GitBook integration
GitBook's developer platform lets you build and install your own integration, and integrations can inject scripts into published content — this is how GitBook's own analytics integrations (Google Analytics, Fathom, etc.) work. A minimal custom integration that injects the Rybbit snippet:
<script
src="https://app.rybbit.io/api/script.js"
data-site-id="YOUR_SITE_ID"
defer
></script>Refer to GitBook's integration documentation for the current manifest format and publishing flow, and note that script injection only applies to published spaces (typically on a custom domain).
Host your docs on a platform with custom-code support
If building an integration isn't worth it for your use case, platforms like Docusaurus, VitePress, Mintlify, or Hugo support adding the Rybbit script directly — see their guides.
Verifying installation
If you do get the script injected via an integration:
- Visit your published documentation through its public URL
- Open the browser Network tab and confirm
script.jsloads andPOSTrequests go to/api/track - Check your Rybbit dashboard for incoming pageviews