Analytics
Rybbit Analytics
Configure Rybbit Analytics
Copy the site ID from your Rybbit tracking snippet. The helper passes it to
the script as data-site-id.
Register the scripts
Complete your framework quickstart first. Keep its Inth endpoint, policy, styles and consent UI. Remove the vendor's original script, SDK initializer or tag-manager entry, so the vendor loads only through c15t.
The vendor pages put the helper in src/consent-scripts.ts. If your framework
quickstart already has a scripts array, such as the one in c15t.config.ts
in the Next.js guide, add the helper to that array instead of creating a
second file.
The scripts export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
point for your framework below. These are edits to that provider, not a second
provider.
Add the configuration to scripts in c15t.config.ts, next to
next.config.ts:
Keep the rest of your config, such as mode and routePrefix, in the
same call. ConsentRoot reads the config in the browser, so the layout
keeps passing only state. App Router, Pages Router and static export all
read the same file. See
Next.js scripts and embeds.
Options
Boolean options become 'true' or 'false' data attributes. An option you
leave unset adds no attribute, so Rybbit uses its own default.
| Option | Default | Behavior |
|---|---|---|
siteId | Required | Site ID as a string or number, set as data-site-id. Empty or whitespace-only values log an error and the script does not load. |
autoTrackPageview | None | Automatic page views, set as data-auto-track-pageview. |
trackSpa | None | Client-side route tracking, set as data-track-spa. |
trackQuery | None | Query strings in tracked URLs, set as data-track-query. |
trackOutbound | None | Outbound link clicks, set as data-track-outbound. |
trackErrors | None | JavaScript errors, set as data-track-errors. |
sessionReplay | None | Session replay, set as data-session-replay. |
webVitals | None | Web Vitals, set as data-web-vitals. |
skipPatterns | None | URL patterns to skip, written as a JSON array to data-skip-patterns. |
maskPatterns | None | URL patterns to mask, written as a JSON array to data-mask-patterns. |
debounce | None | Page view debounce interval, set as data-debounce. |
apiKey | None | Tracking API key, set as data-api-key. The key is visible in the page source. |
analyticsHost | None | Self-hosted Rybbit host. The helper loads <analyticsHost>/script.js. |
scriptUrl | https://app.rybbit.io/api/script.js | Loader URL override. Takes precedence over analyticsHost. Blank values are ignored. |
Loading and revocation
rybbitAnalytics uses the measurement category. The script loads only while
measurement is allowed, and every feature you turn on, including session
replay and Web Vitals, runs under that one category. On revocation the helper
removes the script element and calls no Rybbit API.
Verify Rybbit Analytics
After you allow measurement, the script.js request goes to app.rybbit.io
or your analyticsHost, and its script element carries your data-site-id.
Each option you set appears as a data attribute, including explicit 'false'
values. If your code calls window.rybbit.event or window.rybbit.identify,
check measurement permission before each call.
Test in a private window with an opt-in policy. Open DevTools Network, disable the cache and filter by the vendor's domain:
- Load the page. No request goes to the vendor before you choose.
- Click Reject, then reload. There is still no vendor request.
- Open Privacy settings and allow the helper's category. The vendor script loads without a page reload.
- Turn the category off again and save. c15t reloads the page, and the new page makes no vendor request.
c15t reloads on revocation because removing a script element does not stop
code that already ran. The vendor's listeners, timers and queued events stay
alive until the page unloads. If you set reloadOnConsentRevoked: false, stop
the vendor yourself. Register a callback-only script whose onConsentChange
calls the vendor's opt-out API, as shown in
custom integrations, and check the
permission before each of your own event calls. The reload does not delete
cookies the vendor already set; see
clear on revocation for your framework.
The helper sets vendor to its script ID, so once you declare that vendor a
visitor can turn it off inside an allowed category. See
vendor consent for your framework. The
consent verification guide covers navigation,
expiry and hosting checks.