Getting Started with Privytics
Privytics is a managed, EU-hosted, cookieless product analytics platform. This guide walks you through creating a project, installing the SDK, and sending your first events. It takes about five minutes.
- App and dashboard:
https://app.privytics.com - Ingestion API:
https://api.privytics.com
1. Create a project and get your client id
- Create a free account at app.privytics.com/onboarding, or sign in at app.privytics.com if you already have one.
- Sign-up asks you to create your first project (for example, "My Website" or "Production App"). The free plan includes one project; paid plans can add more.
- Open Project settings → Clients and copy your Client ID.
Your client id is a public identifier used to route incoming events to your project. Throughout this guide it is shown as YOUR_CLIENT_ID.
2. Install the SDK
You can install Privytics with a simple script tag or with the npm package. Both use the same OpenPanel Web SDK under the hood.
Option A: Script tag
Drop this into the <head> of your HTML. It loads the SDK, initializes it with your credentials, and enables automatic screen view and outgoing link tracking.
<script>
window.op =
window.op ||
function (...args) {
(window.op.q = window.op.q || []).push(args);
};
window.op('init', {
apiUrl: 'https://api.privytics.com',
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
trackOutgoingLinks: true,
});
</script>
<script src="https://privytics.com/op1.js" defer></script>
Option B: npm package
Privytics runs the open-source OpenPanel engine, so it uses OpenPanel's open-source SDKs. Install @openpanel/web (OpenPanel's package, published under the @openpanel npm scope) and point apiUrl at Privytics so all data reports to your Privytics project. Privytics is an independent service and is not affiliated with, endorsed by, or sponsored by OpenPanel.
npm install @openpanel/web
import { OpenPanel } from '@openpanel/web';
export const op = new OpenPanel({
apiUrl: 'https://api.privytics.com',
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
trackOutgoingLinks: true,
});
Option C: framework packages (Next.js, React, and more)
The framework packages are OpenPanel's, published under the @openpanel scope, so some defaults point at OpenPanel's infrastructure. One setting you must change, and one you may want to:
| Setting | Required? | Set it to | What it does |
|---|---|---|---|
apiUrl | Required | https://api.privytics.com | Without it the SDK posts your events to api.openpanel.dev, so your data lands in OpenPanel's service rather than your Privytics project |
scriptUrl | Optional | https://privytics.com/op1.js | The component injects a <script> tag that defaults to openpanel.dev/op1.js. The integration works fine either way. Set it if you would rather serve the tracker from a domain you control, so your visitors' browsers do not make a request to a third party |
Next.js:
npm install @openpanel/nextjs
import { OpenPanelComponent } from '@openpanel/nextjs';
export function Analytics() {
return (
<OpenPanelComponent
apiUrl="https://api.privytics.com"
scriptUrl="https://privytics.com/op1.js"
clientId="YOUR_CLIENT_ID"
trackScreenViews
trackOutgoingLinks
/>
);
}
scriptUrl only applies to framework components, because they inject the <script> tag for you. Option A does not need it (you write the src yourself) and Option B does not need it either (your bundler resolves the SDK, including the session-replay recorder, so nothing is fetched from a CDN). OpenPanel's own self-hosting guide keeps their CDN default and changes only apiUrl, so treat scriptUrl as a first-party-delivery preference rather than a correctness fix.
The one thing to carry over from their examples is apiUrl: everything else in the SDK guides applies to you unchanged, and section 7 has the full list.
3. Track custom events
Track any meaningful action with a name and optional properties.
op.track('signup_completed', {
plan: 'pro',
referrer: 'newsletter',
});
op.track('button_clicked', {
label: 'Start free trial',
});
Event names should be human readable and consistent (checkout_started, video_played). Properties can be strings, numbers, or booleans.
4. Identify users
By default, Privytics is fully anonymous and cookieless. When you know who a user is, call identify() to attach your own user id and optional traits.
op.identify({
profileId: 'user_12345',
email: 'jane@example.com',
firstName: 'Jane',
lastName: 'Doe',
properties: {
plan: 'pro',
},
});
Anonymous vs identified
- Anonymous analytics (default, cookieless): No cookies and no device storage are used. An anonymous device id is derived from a daily-rotating salted hash of IP address, user agent, and project id. The salt rotates every midnight UTC, so anonymous ids reset daily. This keeps the data minimal and transient.
- Identified analytics: When you call
identify(), events are linked to theprofileIdyou provide (your own user id). This is data you control. Useidentify()only after you have the appropriate legal basis or consent to associate analytics with a known individual.
To clear the identity, for example on logout:
op.clear();
5. Session replay
Session replay is a paid-plan feature. On the free plan the API does not accept recordings, so turning it on there records nothing. It is off by default and starts only when you enable it in your tracking code. It is built on rrweb and masks all text and inputs by default, so sensitive content is not captured unless you explicitly unmask it. Recordings are kept for 30 days on every plan.
To turn it on, initialize the SDK with sessionReplay: { enabled: true }:
export const op = new OpenPanel({
apiUrl: 'https://api.privytics.com',
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
trackOutgoingLinks: true,
sessionReplay: {
enabled: true,
},
});
With the script tag (Option A), add the same sessionReplay block to the window.op('init', { ... }) call. The recorder then loads on demand from https://privytics.com/op1-replay.js. The snippet under Project settings → Tracking script in the dashboard already includes this block, commented out.
Masking is controlled by maskAllText and maskAllInputs (both on by default) and unmaskTextSelector. Review them before enabling replay in production.
6. Consent gating
If you need to wait for user consent before any data is sent, start the SDK in a disabled state and call ready() once consent is granted.
export const op = new OpenPanel({
apiUrl: 'https://api.privytics.com',
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
trackOutgoingLinks: true,
disabled: true, // no events are sent yet
});
// Later, after the user accepts analytics:
op.ready();
While disabled is true, no events leave the browser. Calling ready() flushes queued events and resumes normal tracking.
7. Supported SDKs and REST API
Privytics works with OpenPanel's SDKs. Point each one at https://api.privytics.com with your client id. OpenPanel publishes seven official JavaScript packages, and one of them covers several frameworks:
- Script tag, plain JavaScript, React, Vue and Remix:
@openpanel/web - Next.js:
@openpanel/nextjs - Nuxt:
@openpanel/nuxt - Astro:
@openpanel/astro - React Native:
@openpanel/react-native - Express:
@openpanel/express - Node and other JavaScript runtimes:
@openpanel/sdk
For Swift, Kotlin, Python, Ruby, Rust and Java there are SDKs outside the @openpanel npm scope, some of them community-maintained. Each one has a setup guide that says how it installs.
Prefer to integrate directly? Send events to the Privytics REST API at https://api.privytics.com using your client id. This is ideal for server-side tracking or languages without a dedicated SDK.
8. Open source and deeper references
Privytics is powered by the open-source OpenPanel analytics engine. Privytics is an independent managed service and is not affiliated with, endorsed by, or sponsored by OpenPanel.
Because the SDKs are shared, the OpenPanel documentation is an excellent deep reference for advanced configuration and per-framework guides. One value in their examples is theirs, not yours: set apiUrl to https://api.privytics.com so your data reaches Privytics. Optionally set scriptUrl too, if you would rather serve the tracker from your own domain than from OpenPanel's CDN. See Option C in section 2.
- SDK references and advanced guides: https://openpanel.dev/docs
Need help?
Reach out any time at hello@privytics.com. Happy tracking.