Verifying an install
The check
Section titled “The check”Turn the sample rate up and debug logging on, temporarily:
init({ projectKey: 'P-ABC123', sampleRate: 1, debug: true });<script async src="https://cdn.ritim.io/latest/browser.min.js" data-project-key="P-ABC123" data-sample-rate="1" data-debug="true"></script>Then:
-
Load the page and wait a few seconds. The send happens after the page settles, so clicking straight through can outrun it.
-
Check the console for
[ritim] measurement sentand the payload. -
Check the network panel for a
POSTto the collector returning202. -
Put the sample rate back and turn debug off when you are done.
When nothing happens
Section titled “When nothing happens”Nothing is logged at all. init() never ran. The usual causes:
- It is running on the server.
init()needswindow— in Next.js it must be in a'use client'component’s effect, and in Nuxt the plugin file has to be named*.client.ts. See Next.js and Nuxt. - The component or plugin holding it is never mounted.
- It is tree-shaken away.
init()has a side effect but no return value; if you wrapped it in something the bundler proved unused, it can go.
It logs, then nothing sends. Almost always the sample rate — the default is
0.25, so most page views do nothing by design. That is what step 1 rules out.
window.RumMonitor is undefined. The bundle did not load. Check the network
panel for the script itself — a 404, a blocked request, or a Content Security
Policy that does not allow the CDN as a script source.
window.RumMonitor exists but nothing sends. Two causes:
- The sample rate. The default is
0.25, so most page views do nothing by design. That is what step 1 rules out. - No
data-project-keyon the tag. Without it auto-init does not start, and the SDK is waiting for aninit()call that never comes.
Content Security Policy
Section titled “Content Security Policy”If you run a CSP you need both directives:
script-src https://cdn.ritim.io;connect-src https://collect.ritim.io;connect-src is the one people miss — and on the npm path it is the only one
that matters, since the SDK is in your own bundle and never loads from the CDN.
The script loads fine, and then every sendBeacon is silently refused.
When the collector rejects it
Section titled “When the collector rejects it”| Status | Meaning |
|---|---|
400 |
The payload did not validate. Usually a hand-rolled request, not the SDK. |
403 |
The key is unknown, or the page’s hostname is not one of the project’s. |
429 |
The project is over its monthly event allowance. See limits. |
When it works but the dashboard is empty
Section titled “When it works but the dashboard is empty”Give it traffic. The dashboard reports p75, and a 75th percentile over four page views is arithmetic rather than information.
It is also worth checking you are looking at the right release — if you just deployed, yesterday’s measurements are under yesterday’s release.
A minimal reproduction
Section titled “A minimal reproduction”When you want to prove the path end to end without your app in the way:
import { init } from '@ritim/browser-sdk';
init({ projectKey: 'P-ABC123', sampleRate: 1, debug: true,});
document.body.innerHTML = '<button id="add-to-cart">Click me</button>';Click the button before the send fires and the INP event will name
#add-to-cart — a quick way to confirm interaction attribution is reaching you.
<!doctype html><meta charset="utf-8" /><title>tag test</title><script async src="https://cdn.ritim.io/latest/browser.min.js" data-project-key="P-ABC123" data-sample-rate="1" data-debug="true"></script><h1>Hello</h1><button id="add-to-cart">Click me</button>Click the button before the send fires and the INP event will name
#add-to-cart — a quick way to confirm interaction attribution is reaching you.