GuidesBackend

Node.js analytics, cookieless and EU-hosted

Server-side event tracking for Node.js. Cookieless by default, hosted in Germany.

Privytics gives your Node.js backend product analytics: funnels, retention, cohorts and user profiles built from events you send from your own server. You install the @openpanel/sdk package, create one client with your project credentials, and call op.track wherever something meaningful happens. Setup is a few lines and there is no browser involved, so nothing is written to a visitor's device.

Why Node.js teams use Privytics

Server-side events are never blocked

Events sent from your Node.js process go straight from your server to https://api.privytics.com. There is no browser request for a content blocker or a tracking-protection list to intercept, so signup, payment and job-completion events arrive whatever the client is running.

Track what the browser cannot see

Webhook deliveries, background jobs, cron runs, queue consumers and Stripe callbacks all happen with no page open. A backend SDK is the only way to get those into a funnel alongside your frontend events.

profileId you already own

On the server you have the authenticated user id in hand. Passing it to op.identify links sessions into one profile without cookies and without any browser fingerprinting, using an identifier you already hold a lawful basis for.

Data is stored in the EU

Your Node.js service posts to an EU endpoint and the event data is stored in Germany. If your backend already runs in the EU, the event data it sends is stored in the EU too.

Set it up

About five minutes, on the free plan, without a credit card.

  1. Install the SDK

    Privytics runs on the open-source OpenPanel engine, so you use the official @openpanel npm package.

    npm install @openpanel/sdk
  2. Create the client

    apiUrl is an optional option in the SDK and defaults to OpenPanel's own host, so you must set it explicitly to send your events to Privytics. clientSecret is what makes server-side tracking work, so keep it in an environment variable and never ship it to a browser.

    // op.ts
    import { OpenPanel } from '@openpanel/sdk';
    
    const clientSecret = process.env.PRIVYTICS_CLIENT_SECRET;
    
    if (!clientSecret) {
      throw new Error('PRIVYTICS_CLIENT_SECRET is not set');
    }
    
    export const op = new OpenPanel({
      apiUrl: 'https://api.privytics.com',
      clientId: 'YOUR_CLIENT_ID',
      clientSecret,
    });
  3. Track an event

    Import the client anywhere in your app and record what happened.

    import { op } from './op';
    
    op.track('my_event', { foo: 'bar' });
  4. Identify the user

    On the server you already know who is making the request. Pass the id you already store for that user as profileId.

    import { op } from './op';
    
    op.identify({
      profileId: '123', // Required
      firstName: 'Joe',
      lastName: 'Doe',
      email: 'joe@doe.com',
      properties: {
        tier: 'premium',
      },
    });
  5. Add properties to every event

    Useful for stamping release and environment onto everything a service sends, so you can split staging from production.

    import { op } from './op';
    
    op.setGlobalProperties({
      app_version: '1.0.2',
      environment: 'production',
    });

Privytics runs the open-source OpenPanel engine, so the upstream Node.js SDK reference applies here too. Point apiUrl at Privytics and the data lands in your Privytics project.

Questions

Does the Node.js SDK use cookies?

No. It runs on your server, so there is no browser and no device to write to. Events are attributed using the profileId you pass yourself, or sent anonymously if you pass none.

Why do I need a client secret for Node.js?

The OpenPanel docs list clientSecret as required for server-side event transmission, since a backend cannot be verified the way a browser origin can. Load it from an environment variable and keep it out of any client bundle.

Can I use the same SDK in the browser?

@openpanel/sdk is the universal JavaScript package, and this is the page OpenPanel documents for Node and generic JavaScript use. Do not reuse the server client in browser code, because that would expose your client secret.

Where is my event data stored?

In EU data centres in Germany. Your Node.js process sends events to https://api.privytics.com and the data is stored in the EU.

Does the free tier work for backend tracking?

Yes. 10,000 events per month, one project and 12 months retention, with no credit card. Server-side events count the same as any other event.