Analytics
Analytics setup
Install TraceKit browser analytics and verify your first pageview.
Install the SDK
Install @tracekit/browser in the application that you want to measure.
npm install @tracekit/browserGet the Public ctxio_pub_... key from TraceKit API keys.
Match serviceName to the active TraceKit service.
import { init } from '@tracekit/browser';
init({
apiKey: 'ctxio_pub_...',
serviceName: 'your-service-name',
});First pageview
Your first pageview appears after TraceKit initializes.
Verify the first pageview
Visit your application after init() runs.
init() records the first pageview automatically.
SPA route changes record later pageviews.
The query strings and fragments are removed from URLs and referrers. The allowed origins are optional and comma-separated. An empty allowed-origin list allows every origin.
If pageviews are missing, confirm the Public key, serviceName, allowed origin, and browser consent settings.
Then reload the page.
Continue
- Track goals with browser or server events.
- Connect Stripe for revenue attribution.
- Read the analytics reference for formulas and limits.