PostHog / PostHog/posthog

GeoIP enrichment returns null for all cookieless server hash events

Open
#48,660 4 comments 3 reactions 1 assignee View on GitHub

@lricoy is already working on this.

Since May 19, 2026.

team/web-analytics
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

We’re running cookieless_mode: 'always' on EU Cloud. GeoIP transformation is enabled and runs — $transformations_succeeded confirms it — but every single cookieless event has null geo fields. Cookie-based events in the same project get GeoIP fine.

Queried last 7 days:

ID type Geo present Event count
cookie-based yes 1,138
cookie-based no 399
cookieless yes 0
cookieless no 21,947

$ip is null on all cookieless events. That’s why GeoIP “succeeds” but returns nothing — there’s no IP to look up.

Looking at PR: https://github.com/PostHog/posthog/pull/27290 the IP gets stripped after the hash is generated but before transformations run. So GeoIP never sees it.

This seems like an oversight, because the “Discard client IP data” project setting already handles this correctly. From the docs:

When this setting is enabled:
• Client IP addresses are not stored with your events
• Transformations like GeoIP enrichment and bot detection can still use the IP before it is discarded

That’s the right pattern — run GeoIP, then discard the IP. Country/city aren’t PII under GDPR. Other cookieless analytics tools (Rybbit, Plausible) all do exactly this — resolve geo from the IP, store only the country/city, discard the raw IP.

Cookieless mode just needs to do the same thing: pass the IP through to transformations before stripping it, rather than stripping it first.

To reproduce: enable cookieless_mode: 'always' with GeoIP transformation, capture events from a public IP, query $geoip_country_name — all null.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.