Skip to content

No. 02Frontend8 min read2,001 words

Privacy-friendly product analytics: a practical guide

Privacy-friendly product analytics for founders and teams: what to measure, which tools to use, how to name events, and how to stay clear of creepy tracking.

Written by
Lazy Devs
Published
Updated
Sources
Cited inline

Key takeaways · 05

The short version

  1. 01Product analytics means counting events inside your own product, such as signup_completed or project_created. You can answer most product questions without third-party pixels, cross-site identifiers or personal data.
  2. 02Start with cookieless page analytics for traffic, then add first-party event analytics for the five to ten events that define activation. Add more only when a specific question needs one.
  3. 03Decide an event naming convention (object_action in past tense) before the first event, and enforce it with a typed wrapper so typos fail the build.
  4. 04Keep personal data out of event properties: use a stable internal user ID, never an email, and mask every input by default in session replay.
  5. 05Honour Global Privacy Control signals and offer an opt-out. Do Not Track is deprecated, and GPC is recognised as an opt-out signal under California's CCPA.
On this page · 08

Privacy-friendly product analytics means measuring what happens inside your own product, such as sign-ups, activations and feature use, with first-party events and no personal data, instead of third-party scripts that follow people across the web. You can answer almost every question a product team actually asks without knowing who someone is or what else they browse. The setup is also faster, cheaper and easier to defend than the kitchen-sink alternative.

Most analytics setups we see land in one of two bad places. Either there is nothing and the team is guessing about what users do, or someone bolted on half a dozen tracking scripts that slow the site down and quietly become a legal liability. There is a sane middle, and it is closer than you think.

What you actually want to know

Before picking a tool, get clear on the questions. Founders often say "we need analytics" when they really mean one of a few specific things:

  • Are people getting through onboarding, or dropping off at step three?
  • Which features get used, and which ones did we build that nobody touches?
  • Where does the sign-up funnel leak?
  • Did the change we shipped last week make activation better or worse?
  • Do people come back in their second and fourth week?

None of those require knowing a user's name, their other browsing habits or their device fingerprint. They require knowing what happens inside your product, in aggregate. That distinction is the whole game. The moment you collect data you do not need for a decision you are about to make, you have crossed from product analytics into surveillance and taken on risk for no payoff.

Product analytics versus the creepy stuff

Product analyticsThe creepy stuff
Events in your own app: signup_completed, project_created, invite_sentThird-party pixels that report visits to ad networks
A random internal user IDEmails, names or fingerprints sent to vendors
Aggregate funnels and retentionProfiles of a person across many websites
Session replay with every input maskedRecordings that capture everything someone types
Data you can delete on requestData copied to vendors you cannot easily audit

You can have everything in the left column without anything in the right one.

The privacy-friendly analytics toolbox

From lightest to heaviest:

Cookieless page analytics

Tools such as Plausible, Fathom or a self-hosted Umami give you traffic, referrers and top pages without cookies and without collecting personal data. Plausible publishes its data policy explaining exactly what it collects and how visitors are counted without persistent identifiers. Scripts in this category are small, setup is genuinely an afternoon, and in many cases you can avoid a consent banner for them. This answers "how much traffic, from where, to which pages", not "what do users do inside the app."

Event-based product analytics

This is the real work. PostHog (open source and self-hostable) and Amplitude are common picks. You instrument named events in your code, then build funnels, retention and cohort charts on top. Self-hosting gives you control and keeps data on your infrastructure, which makes the privacy story easy to explain, but you then own the database, upgrades and backups. For most early-stage teams we start on a hosted plan in an EU or US region that matches where the users are, and revisit later.

Server-side events

Some of your most important events happen on the server: a subscription started, an invoice paid, an export generated. Send those from your backend, not the browser. They are more reliable (no ad blockers, no closed tabs), they cannot be spoofed by a user, and they never touch a third-party script on the page.

Session replay

Useful for finding confusing UI, and the most likely thing to bite you. If you record sessions, mask every input and all text by default and unmask only what you deliberately decide is safe. Most tools, including PostHog's replay privacy controls, support this. Otherwise you will capture passwords, card numbers and private messages, and that recording becomes the most sensitive data in your company.

Tool typeAnswersPersonal data riskEffort
Cookieless page analyticsTraffic, sources, top pagesLowAn afternoon
First-party event analyticsFunnels, activation, retentionLow to medium, depending on propertiesA few days for the first events
Server-side eventsRevenue and lifecycle eventsLowSmall, alongside backend work
Session replayWhy users get stuckHigh unless maskedLow to set up, ongoing care
Ad and retargeting pixelsAd attributionHighLow to add, high to justify

Questions to ask any analytics vendor

Before you add a script, ask these. The answers are usually in the vendor's documentation or data processing agreement, and if they are not, that tells you something.

  1. Where is the data stored and processed? Pick a region that matches your users and your obligations.
  2. Does the tool set cookies or use persistent identifiers by default? And can you turn them off?
  3. Can you delete a single user's data on request? You will need to.
  4. Does the vendor use your data for anything else, such as training models or building its own audiences?
  5. Can you self-host or export everything? Lock-in matters when your product history lives in one tool.
  6. What does the script cost in page weight and main-thread time? Measure it on a mid-range phone, not your laptop.

Instrumentation: the part teams get wrong

The tool is the easy decision. What determines whether your analytics are useful in a year is your event naming, and almost everyone does it ad hoc until it becomes a swamp.

Decide on a convention before you write the first event, and write it down:

  1. Use object_action in past tense: project_created, invite_accepted, subscription_canceled.
  2. Keep property names consistent across events: plan, source, team_size.
  3. Keep a list of approved events somewhere a human reads, with what each one means and which chart it feeds.
  4. Treat a new event as a small decision, reviewed like any other code change.
  5. Never rename an event in place. Add the new one, keep both for a while, then retire the old one, or your historical charts break.

Six months in, the difference between a team that did this and one that did not is the difference between "let me pull that funnel in two minutes" and "we have clicked_button, btn_click and ClickedButton, so nobody trusts the numbers."

A thin, typed wrapper keeps call sites clean and gives you one place to enforce the rules, including respecting privacy signals:

// lib/analytics.ts
import posthog from "posthog-js";
 
type Events = {
  signup_completed: { plan: "free" | "pro"; source: string };
  project_created: { template: string };
  invite_sent: { role: "admin" | "member" };
};
 
function optedOut(): boolean {
  if (typeof navigator === "undefined") return true;
  // Global Privacy Control: a browser-level "do not sell or share" signal.
  return (navigator as Navigator & { globalPrivacyControl?: boolean })
    .globalPrivacyControl === true;
}
 
export function track<E extends keyof Events>(event: E, props: Events[E]) {
  if (optedOut()) return;
  // No personal data in props: no names, emails or raw input values.
  posthog.capture(event, props);
}

The type map does quiet work: a typo, an invented event name or a missing property fails the build instead of silently polluting your data. That is one of the most practical payoffs of strict TypeScript.

How to keep analytics on the right side of the line

You do not need a lawyer to get the basics right, but you should talk to one before launch, especially in a regulated space. This is engineering guidance, not legal advice.

  • Collect for a decision, not "just in case." If you cannot name the chart an event feeds, you probably do not need the event. Data minimisation is also a core principle of the GDPR.
  • Keep personal data out of event properties. Use a random internal user ID, not an email, as the identifier. A hashed email is still personal data, because it can be matched back to a person. Join analytics IDs to real users in your own database only when you genuinely need to.
  • Honour privacy signals. The old Do Not Track header is deprecated. Its successor, Global Privacy Control, is a browser signal that California's attorney general recognises as a valid opt-out of the sale or sharing of personal information under the CCPA. Respecting it is a few lines of code.
  • Understand consent rules for your users. In the EU and UK, storing or reading information on someone's device generally needs consent unless it is strictly necessary, and the European Data Protection Board's guidelines on consent set out what valid consent looks like. Cookieless, aggregate, first-party analytics is the easy mode. Third-party trackers and identifiable data bring consent banners and paperwork.
  • Be especially careful with health and financial data. Regulators have taken action against companies whose tracking pixels shared sensitive health information with ad platforms. If you are building in healthtech, our guide to building HIPAA-conscious software covers why tracking technologies on authenticated pages need extra care.
  • Set a retention period. Raw event data rarely needs to live forever. Decide how long you keep it and configure the tool to delete it.

Why lean analytics is also faster

The reward for discipline is not only legal comfort. Every tracking script is weight on the page, work on the main thread and another third party you trust with your users. A lean setup loads faster, which helps the conversion numbers you are trying to measure. We see this most clearly on stores, as we explain in how site speed affects e-commerce revenue, and it is a regular part of our performance and SEO engineering work.

A few practical rules:

  • Load analytics after the page is interactive, never in a way that blocks rendering.
  • Send revenue and lifecycle events from the server instead of adding client scripts for them.
  • Review installed scripts every quarter and remove anything nobody looked at.
  • When you do defer or remove scripts, verify the events you care about still arrive.

Third-party scripts add up quickly: in our speed test of the Forbes Cloud 100 homepages, the median homepage contacted 20 or more third-party domains. Our web performance statistics collect the research on what that weight costs.

A realistic analytics rollout for an early-stage product

For a typical early-stage app, this timeline holds up:

  1. Day one: add cookieless page analytics for the marketing site.
  2. Week one: set up event analytics and instrument the five or so events that map to your activation funnel: sign-up, the first meaningful action and the moment users get real value. Not forty events.
  3. Weeks two to four: build the funnel and retention charts, and watch them against real releases.
  4. Ongoing: add events only when a specific question demands one, and prune events no chart uses.

The instrumentation is usually a day or two of focused engineering for those first events, plus the ongoing habit of adding new ones carefully. The trap is treating it as a one-time install rather than a small, continuous discipline. Once the funnel is in place, it becomes the backbone of activation work like we describe in reducing SaaS churn with better onboarding.

Clearer data, fewer risks

You can understand your product without creeping out the people using it. Start with cookieless page analytics for traffic, add first-party event analytics for the handful of actions that define activation, send revenue events from the server, name your events like you will still be reading them next year, and keep personal data out of the analytics layer entirely. That setup is faster, cheaper, easier to defend and clearer to reason about.

If you want analytics wired into your product properly, without it turning into a tracking-script free-for-all, tell us what you are building.

If you serve visitors in the EU or UK, read what GDPR cookie consent requires before you add any analytics script.

Several analytics tools double as flag platforms; see the best feature flag tools in 2026.

FAQ · 05 questions

Frequently asked questions

Do I need a cookie banner for analytics?

It depends on the tool and where your users are. Under EU and UK rules, storing or reading information on a device generally needs consent unless it is strictly necessary, and many regulators treat ordinary analytics cookies as needing consent. Cookieless tools that collect no personal data reduce or remove that requirement in many cases. This is engineering guidance, not legal advice, so confirm with a privacy lawyer for your situation.

Is Google Analytics GDPR compliant?

It can be used in a GDPR-compliant way, but it takes work: a valid consent mechanism, correct configuration of Consent Mode, data processing terms and an honest privacy notice. Several European data protection authorities have challenged specific deployments in the past. If you only need traffic and simple funnels, a privacy-first tool is usually simpler to defend.

What is the difference between product analytics and web analytics?

Web analytics answers how many people visit, where they come from and which pages they view. Product analytics answers what people do inside your product: whether they complete onboarding, which features they use and whether they come back. Most startups need a light version of both.

Is hashing an email address enough to anonymize it?

No. A hashed email is still a stable identifier that can be matched back to a person, so data protection law generally treats it as pseudonymous personal data, not anonymous data. Use a random internal user ID in analytics and keep the link to real identities inside your own database.

Is session replay legal?

Session replay can be used lawfully, but it is the highest-risk analytics tool because it can capture anything a person types or sees. Mask all inputs and sensitive text by default, exclude pages with health, payment or account data, disclose it in your privacy notice and obtain consent where the law requires it.

Filed underFrontendStartups

Related service

Web App Development

Production React and Next.js apps, built to last.

Learn more

Next step

Want this built right?

This is the work we do every day. Tell us what you are building and we will show you exactly how we would ship it.

First reply
Within 1 business day
Typical start
1–2 weeks
Pricing
Fixed price per phase
You own
All code and accounts