Skip to main content
Auth0 → PostHogIntegration guide

Connecting Auth0 to PostHog

Auth0 issues the user identity that everything downstream joins on, which makes it the system that decides whether an anonymous visitor and a paying customer can ever be connected. PostHog can be self-hosted, which changes the calculus entirely: the data stays on infrastructure you control, and so does the responsibility for everything that goes wrong with it. The join between them succeeds or fails on one thing: whether the distinct_id reaches the Auth0 user identity before the conversion happens, because PostHog can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Auth0 login and PostHog identify: merging the pre-signup visitor

Call PostHog identify with the Auth0 user_id on the first page after the callback to merge the anonymous visitor, sharing the cookie across marketing and app subdomains. Call posthog.reset on logout, keep email as a person property, and send billing revenue through the capture API with the same distinct_id and an event UUID.

PostHog's job here is connecting the anonymous distinct_id that browsed your marketing pages with the person Auth0 authenticates. Call identify with the Auth0 user_id on the first page after the callback, and PostHog merges the earlier anonymous events into that person. If the marketing site and the app live on different subdomains, check that PostHog's cookie is shared across them, or the anonymous ID on each side of the login will differ and nothing merges.

Reset on logout. Without posthog.reset, the next person who signs up in the same browser gets identified on top of the previous user's anonymous ID, and two people's funnels blend. Also avoid calling identify with the email, which can change and would then split the person; set email as a person property instead.

Revenue events come from billing through the capture API with the same distinct_id and an event UUID, so retried webhooks do not double. Self-hosting changes this pair in one specific way: an instance on your own subdomain is not blocked like a third-party analytics call, so the login merge actually happens for users who run blockers, which is often a large share of a technical product's audience.

Auth0 → PostHog · what breaks

Why this join usually fails — Auth0 → PostHog

  1. 01

    The distinct_id never reaches Auth0

    Login flows redirect to a hosted Auth0 domain and back, which breaks the session and can lose an identifier captured before login.

  2. 02

    The login redirect losing the acquisition source

    The visitor arrives from an ad, clicks sign in, goes to Auth0's domain and comes back as a fresh session. Without deliberate persistence the campaign that produced them is gone at exactly the moment they became identifiable.

  3. 03

    Self-hosting the analytics and the outage together

    The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.

  4. 04

    Nothing reconciles afterwards

    PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.

Auth0 → PostHog · the fix

What working looks like — Auth0 → PostHog

  • The distinct_id on every account

  • Conversions arriving in PostHog

    The event lands on the person profile and becomes available in insights, funnels and session replay.

  • Reconciled against the source

Auth0 → PostHog · architecture

How Auth0 and PostHog actually connect

  1. 1

    Auth0 holds the truth

    Auth0 holds identity, not money. Its value to measurement is that it provides the stable key which lets a pre-signup session and a later subscription be recognised as one person.

  2. 2

    PostHog needs a click to match

    PostHog needs a distinct_id, an event name and its properties. Self-hosted instances additionally need the ingestion endpoint reachable and the project API key correct, which is a class of failure hosted tools do not have.

  3. 3

    The identifier is the bridge

    The distinct_id, captured at the visit and carried into the Auth0 user identity.

  4. 4

    The event source decides reliability

    Send paid conversions keyed on the user identity. Signups are a stage, not revenue.

  5. 5

    Deduplication at the destination

    PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.

Auth0 → PostHog · normal or broken

Working vs. broken, side by side — Auth0 → PostHog

Normal, not a fault

  • The distinct_id present on the account

  • Sent from your billing system, keyed on the Auth0 user ID

  • Deduplicated correctly

    PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.

  • Reconciles with the source

Actually broken

  • The distinct_id missing on most records

    Login flows redirect to a hosted Auth0 domain and back, which breaks the session and can lose an identifier captured before login.

  • Sent from the browser

    The visitor arrives from an ad, clicks sign in, goes to Auth0's domain and comes back as a fresh session. Without deliberate persistence the campaign that produced them is gone at exactly the moment they became identifiable.

  • Counted twice, or not at all

    The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.

  • Nobody has reconciled it

Auth0 → PostHog · diagnose

Diagnostic order — Auth0 → PostHog

  1. 01

    Count accounts carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether the identifier survives the login round trip

    Test it on a live login. This is the single most common identity break in products that use hosted authentication.

  4. 04

    Check ingestion health and disk before debugging any missing event

    On self-hosted instances the answer is infrastructure far more often than it is instrumentation.

  5. 05

    Read the match rate, not the success message

    PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.

Auth0 → PostHog · prove

How it gets proven — Auth0 → PostHog

Source of truth

Your billing system, joined to the Auth0 user ID.

  • The distinct_id confirmed present on a live account.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Paid conversions reconciled per user identity against imported conversions, with identifier survival verified across login.

Auth0 → PostHog · free audit

What we check in the free audit

  • Count accounts carrying the distinct_id
  • Follow one real conversion end to end
  • Check whether the identifier survives the login round trip
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Your billing system, joined to the Auth0 user ID.

Get my free conversion tracking audit

Free30 minutesNo obligation

Auth0 → PostHog · when not to buy

When you don't need this — Auth0 → PostHog

  • Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the distinct_id.
  • If your product has no authentication, there is no identity to join and session-level attribution is all there is.
  • If you have no reason to keep the data on your own infrastructure and no team to run it, the hosted product removes the only real downside of this one.

Auth0 → PostHog · what we deliver

What gets built — Auth0 → PostHog

  • Identifier capture into Auth0

    Persist the identifier before the redirect and write it onto the user's app metadata at first login, so it survives every subsequent session.

  • Event source: your billing system, keyed on the Auth0 user ID

    Send paid conversions keyed on the user identity. Signups are a stage, not revenue.

  • Dispatch to PostHog

    The PostHog capture API, posted server-side from your backend to your own instance or to PostHog Cloud.

  • Reversals where they exist

    Cancellations reverse against the same identity.

Written guarantee

95%+ tracking accuracy

Measured against Your billing system, joined to the Auth0 user ID.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Auth0 → PostHog questions, answered

The Auth0 user_id. Put email in person properties so a changed address does not create a second person.

Free · 30 min

Get Auth0 and PostHog joined properly

Free30 minutesNo obligation