Pirsch
Privacy-friendly, cookie-free web analytics for the browser and server.
Pirsch is a cookie-free, GDPR-compliant web analytics platform. It focuses on page views and lightweight events without tracking users across sites.
When to use it
Reach for Pirsch when you want privacy-first web analytics:
- No cookies and no cross-site tracking.
- IP addresses are anonymized.
- GDPR, CCPA, and PECR compliant by design.
It is built for page views and simple events, not for identified user lifecycle automation. For email-triggered flows on identified users, pair it with Bento.
Installation
No extra package is required. The client provider loads the Pirsch script at runtime, and the server provider calls the Pirsch API directly.
pnpm install trakoo
Client-side usage
Pass your Pirsch identification code and the hostname registered in your Pirsch dashboard.
import { createClientAnalytics } from 'trakoo/client';
import { PirschClientProvider } from 'trakoo/providers/client';
export const analytics = createClientAnalytics({
providers: [
new PirschClientProvider({
identificationCode: 'your-pirsch-identification-code',
hostname: 'example.com'
})
]
});
await analytics.initialize();
Server-side usage
Pirsch supports two authentication modes. An access key is simpler because it skips the OAuth token refresh.
Use a client secret that starts with pa_.
import { createServerAnalytics } from 'trakoo/server';
import { PirschServerProvider } from 'trakoo/providers/server';
export const serverAnalytics = createServerAnalytics({
providers: [
new PirschServerProvider({
hostname: 'example.com',
clientSecret: process.env.PIRSCH_ACCESS_KEY!, // starts with 'pa_'
protocol: 'https'
})
]
});Provide both clientId and clientSecret.
import { createServerAnalytics } from 'trakoo/server';
import { PirschServerProvider } from 'trakoo/providers/server';
export const serverAnalytics = createServerAnalytics({
providers: [
new PirschServerProvider({
hostname: 'example.com',
clientId: process.env.PIRSCH_CLIENT_ID!,
clientSecret: process.env.PIRSCH_CLIENT_SECRET!,
protocol: 'https'
})
]
});Configuration
Client options:
identificationCodestring
The identification code from your Pirsch dashboard.
stringhostname?string
The domain registered in Pirsch.
stringServer options:
hostnamestring
The domain registered in Pirsch.
stringclientSecretstring
Access key (starts with 'pa_') or the OAuth client secret.
stringclientId?string
OAuth client ID. Required only when using OAuth authentication.
stringprotocol?'http' | 'https'
Protocol used to reach the Pirsch API.
'http' | 'https'https