# Privacy-first game analytics with first-party anonymous IDs

> Collect events with a random first-party anonymous ID. Raw IPs and user agents are not stored, and an optional consent mode stores nothing before consent.

Canonical URL: https://manalens.dev/features/cookieless-analytics

Collect game and website events with a random first-party anonymous ID. Raw IP addresses and user agents are not stored, and an optional consent mode stores nothing before consent.

[How to install](https://manalens.dev/docs/install)

## A first-party anonymous ID

The SDK creates a random UUID and stores it in a first-party cookie, with localStorage or memory as fallbacks. It is not derived from IP address or user agent. The ID persists across days, so returning visitors, cross-day journeys, and D1, D7, and D30 retention are measured.

## Minimal request data

The collector does not store raw IP addresses or raw user agents. It derives only country (an in-memory IP lookup with Cloudflare's geofeed for Cloudflare addresses, then the DB-IP database; the IP is then discarded), device, OS, and browser. URL query strings and fragments are removed except allowlisted UTM fields and ad click IDs. Known bots are filtered.

## Explicit identity is a separate choice

identify(userId, traits) lets your application attach a known account ID after login. The SDK adds user_id to later events and links it to the anonymous ID. Backends can also send identify and track events to the same endpoint with a Secret key that stays on the server.

## Review the whole collection path

Selected campaign parameters and optional traits are still data. Review server logs, queue payloads, URLs, property values, and your legal obligations before deployment. Site owners decide whether consent is required; the SDK offers an optional opt-in consent mode that stores nothing and sends no visitor ID before consent.

## Frequently asked questions

**Does privacy-first mean no data is collected?**

No. Page paths, event properties, selected campaign fields, and request-derived context can still be collected.

**Can you recognize anonymous visitors across days?**

Yes. The first-party anonymous ID persists across days in the same browser. Explicit user IDs connect known account activity across devices.

**Do you store raw IPs with events?**

No. The analytics event pipeline stores the anonymous ID and derived context such as country and device, not raw IPs or user agents. Operators should separately review infrastructure access logs.

## Explore next

- [How collection works](https://manalens.dev/docs/privacy)
- [Privacy-friendly game analytics](https://manalens.dev/blog/privacy-friendly-game-analytics-gdpr)
- [Visitor definition](https://manalens.dev/glossary/daily-visitor)

Implementation reviewed 2026-11-18.
