All articles Privacy & compliance

Privacy First Analytics: What to Collect and Skip

Abstract dark scene of a glass data conduit filtering glowing blue particles, with unfiltered particles dissolving into black space.

Privacy first analytics starts with an unglamorous question: which fields does your product actually need to answer the questions you ask every week? Most teams inherit their event schema from whatever SDK they installed first — user agent, full URL, referrer, IP address, sometimes a raw form payload — and then spend a year arguing about what to delete.

The practical answer is to design the payload as an allowlist. You decide in code which keys an event may carry, and everything else is dropped before the request leaves the browser. Then you repeat the same check on the server, because a browser is not a trust boundary.

This guide covers the fields worth keeping, how keys that look like personal data get stripped in two places, and why bot sessions must be excluded before any of those numbers mean anything.

Start from the questions, not the SDK

Write down the five questions your team asks every week. Typical ones: where do users drop in onboarding, which pricing page converts, what do retained accounts do in week two. Each question needs a small set of keys, and everything outside that set is pure cost — storage, risk, and review time.

The fields that earn their place

  • A stable anonymous session or visitor identifier generated by your own code, not copied from a third-party cookie.
  • Event name, timestamp, and the route or screen where it happened.
  • A short list of dimensions you actually slice by: plan, device class, app version, experiment bucket, locale.
  • Numeric properties: amount in minor units, item count, step index, duration.
  • An account or user identifier when the user is authenticated and that identifier is internal (a UUID, not an email).

The fields to skip by default

Raw email, phone, full name, street address, free-text form bodies, IP addresses, and full referrer or query strings that can carry tokens or session identifiers. If an event needs to know whether two events came from the same person, a keyed hash answers that question without storing the value.

Strip personal-data-looking keys in the browser

The browser is where most leakage happens, because an SDK that accepts a generic object will forward whatever the caller passed. Enforce an allowlist at the transport layer:

Close-up of a translucent panel acting as a filter that stops small glowing blue shapes on a black desk.

const ALLOWED = new Set(["plan", "route", "deviceClass", "stepIndex"]);
const clean = (props) =>
  Object.fromEntries(Object.entries(props).filter(([k]) => ALLOWED.has(k)));

Three habits make this hold:

  • Deny unknown keys instead of redacting known-bad ones; blocklists always lag behind.
  • Hash where identity matters, drop where it does not. A keyed hash with a secret that never reaches the client lets you join events later. An unkeyed hash of an email is not protection: the input space is small enough to enumerate.
  • Keep tokens out of URLs. If your router records the full route with query strings, strip them before the event is built.

Check the payload again on the server

Browser code can be edited, blocked, or replaced by an extension, so treat the incoming payload like any other untrusted input: validate the shape, refuse unexpected keys, cap string length, and drop events that fail. Log the rejection count — a sudden rise usually means a broken release, not an attack.

On the server, keep secrets out of client bundles, rotate them on a schedule, set a retention window per event type, and write down who can query raw events. When a processor handles the data for you, the contract matters as much as the code: Prynt publishes its data processing addendum at /dpa.

Exclude bots before they touch your funnel

A clean schema does not fix a dirty sample. Automated traffic inflates page views, fills signup funnels with sessions that never verify, and drags retention toward zero — and the error compounds because every downstream chart inherits it.

Dark server corridor with black racks, a thin blue light line on the floor and a floating translucent glass panel with faint grey dots.

Prynt Analytics excludes bot sessions from counts rather than filtering them later in a dashboard. Signals that matter in practice: headless browser markers, missing or inconsistent browser APIs, datacenter and proxy ranges, and fast repeated navigation. AI agents and crawlers belong on that list too, and detection has to keep pace with them — see our notes on bot detection.

Use the smaller dataset properly

Once the payload is lean and the traffic is human, analysis gets simpler. Build funnels of two to eight steps for the flows you own end to end, define a few goals with identical event names across web and mobile, and read weekly retention by signup cohort instead of one blended number. Prynt Analytics runs at $39/month with a 14-day trial and honors Global Privacy Control signals.

FAQ

Overhead abstract view of grey dots in rigid lines dissolving into blue light, leaving a sparse pattern of white dots on black.

Is a hashed email safe to store in analytics?

A keyed hash with a secret held server-side is far better than plaintext, but it is still pseudonymous data in most privacy regimes, so keep it inside a defined retention window. An unkeyed hash of an email or phone number can be reversed by enumeration.

That depends on your jurisdiction and on what counts as personal data for the identifiers you keep, so treat it as a question for your counsel rather than a product setting. What you can do is shrink the surface: allowlist the payload, hash or drop identifiers, and respect opt-out signals such as Global Privacy Control.

How should I treat IP addresses?

They are the field most likely to be personal data and least likely to answer a product question. Derive what you need at request time — country, datacenter or proxy signal — and store the derived value, not the address.

Start with the allowlist this week

Ship the allowlist, add the server-side check, and compare a week of bot-included numbers against bot-excluded ones: the gap tells you how much of last quarter’s funnel was noise. Prynt Analytics is part of the Prynt platform, on one account with Identify, Control, Replay, Revenue AI and Automate. Start the 14-day trial at pryntid.com.

Try it free

Prynt is device intelligence with a free plan: 5,000 identifications a month, visitor IDs with confidence and bot detection — no credit card. Upgrade to Pro for VPN, proxy, tampering and behavioral signals.

Keep reading