Track calls succeed but nothing shows in the dashboard, turned out the test transport was on
Writing this up partly to confirm my diagnosis and partly so the next person finds it. Timeline:
- Last Tuesday we deployed a release that included new CI configuration.
- Wednesday I noticed the events feed in the dashboard had gone quiet, even though every croct.track call in the app resolved without errors.
- Locally everything worked. Production builds were the only ones affected.
- Digging through the deploy config I found NEXT_PUBLIC_CROCT_TEST=true had been added globally for the CI test stage and leaked into the production build environment.
So my working theory is that this flag swaps in some kind of mock transport, which is why the calls succeed but no events arrive. Is that what it does, and what is the intended way to scope it so this cant recur?
1 answer
Your diagnosis is exactly right, nothing else to find. NEXT_PUBLIC_CROCT_TEST enables a mock event transport: the SDK behaves normally from the application's point of view, calls resolve successfully, but no events leave the browser. It exists precisely so test runs do not pollute your real data, which also explains why it is silent, a test mode that logged errors would fail the tests it is meant to support.
The scoping gotcha is the NEXT_PUBLIC_ prefix: those variables are inlined into the bundle at build time. So it is not enough for the production runtime to unset it, the production build itself must be created without the flag.
The intended setup:
- Set NEXT_PUBLIC_CROCT_TEST=true only in the environment that runs tests (CI test stage, local test scripts).
- Keep it out of any environment that produces a deployable build. In Vercel and most platforms this means scoping the variable per environment instead of defining it globally.
Once the fixed build ships, the Integration page in the dashboard is the quickest confirmation: it shows a green "Received traffic in the past 24 hours" indicator when real events are flowing again.