Skip to main content
MemberPress → PostHogIntegration guide

Connecting MemberPress to PostHog

MemberPress runs memberships inside WordPress, which means you own the database and inherit every WordPress problem alongside it. 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 MemberPress subscription 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

MemberPress to PostHog: content usage that predicts churn

Use PostHog to see which members stop using what they pay for. Call identify with the WordPress user ID on the first logged-in page view, use the same distinct_id for server events from MemberPress hooks (started, renewed, payment failed, cancelled), set event UUIDs from transaction IDs, and capture content consumption in the browser to build pre-renewal churn cohorts.

PostHog is the destination here that answers a membership question, not an advertising one: which members stop using what they pay for before they cancel. The join is simple because members log in. Call identify in posthog-js with the WordPress user ID on the first logged-in page view after signup, which merges the anonymous pre-signup browsing, and use that same ID as distinct_id on server events.

From the MemberPress hooks, send membership started, renewed, payment failed and cancelled, with level, price and billing period as properties. From the browser, capture what members actually consume: lessons completed if you use MemberPress Courses, protected pages viewed, downloads. Set the event UUID on server events from the transaction ID so a retried webhook does not create a second renewal.

Then build the cohort that matters: members whose content activity dropped in the 30 days before renewal, compared with those who renewed. That is a list you can act on, unlike a conversion count. Caching does not interfere with posthog-js, but logged-in pages are usually uncached anyway, so identify will run where it needs to.

MemberPress → PostHog · what breaks

Why this join usually fails — MemberPress → PostHog

  1. 01

    The distinct_id never reaches MemberPress

    Page caching serves a cached render to the visitor, so anything relying on a dynamically populated field can silently fail. The identifier has to be captured and stored as subscription metadata server-side, not carried in a rendered page.

  2. 02

    Caching between the visitor and your code

    The same problem that breaks WooCommerce tracking. A cached page never runs your capture logic, and the failure is invisible because the site still works.

  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.

MemberPress → PostHog · the fix

What working looks like — MemberPress → PostHog

  • The distinct_id on every membership

  • Conversions arriving in PostHog

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

  • Reconciled against the source

MemberPress → PostHog · architecture

How MemberPress and PostHog actually connect

  1. 1

    MemberPress holds the truth

    Owning the database is the advantage — you can query it directly and reconcile without depending on anyone. The disadvantage is that caching, plugin conflicts and optimisation tools sit between your visitor and your code.

  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 MemberPress subscription.

  4. 4

    The event source decides reliability

    Fire server-side from the PHP hook, which runs regardless of caching, and value recurring memberships over their expected life.

  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.

MemberPress → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the membership

  • Sent from the MemberPress transaction-completed hook

  • 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

    Page caching serves a cached render to the visitor, so anything relying on a dynamically populated field can silently fail. The identifier has to be captured and stored as subscription metadata server-side, not carried in a rendered page.

  • Sent from the browser

    The same problem that breaks WooCommerce tracking. A cached page never runs your capture logic, and the failure is invisible because the site still works.

  • 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

MemberPress → PostHog · diagnose

Diagnostic order — MemberPress → PostHog

  1. 01

    Count memberships carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Submit a test signup through a fully cached page

    Not as a logged-in admin, which bypasses the cache. If the metadata is empty on the cached path, caching is your cause.

  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.

MemberPress → PostHog · prove

How it gets proven — MemberPress → PostHog

Source of truth

MemberPress transactions and subscriptions in your own WordPress database, for the same window.

  • The distinct_id confirmed present on a live membership.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Subscription metadata confirmed populated on a signup made as an anonymous visitor through cache.

MemberPress → PostHog · free audit

What we check in the free audit

  • Count memberships carrying the distinct_id
  • Follow one real conversion end to end
  • Submit a test signup through a fully cached page
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

MemberPress transactions and subscriptions in your own WordPress database, for the same window.

Get my free conversion tracking audit

Free30 minutesNo obligation

MemberPress → PostHog · when not to buy

When you don't need this — MemberPress → PostHog

  • Measure identifier coverage yourself first — pull your last hundred memberships and count how many carry the distinct_id.
  • If you run no caching layer and a single membership tier, a developer can wire this in an afternoon.
  • 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.

MemberPress → PostHog · what we deliver

What gets built — MemberPress → PostHog

  • Identifier capture into MemberPress

    Capture the identifier and write it to subscription metadata through a MemberPress or WordPress hook, so it lives in your database rather than in a page that might be cached.

  • Event source: the MemberPress transaction-completed hook

    Fire server-side from the PHP hook, which runs regardless of caching, and value recurring memberships over their expected life.

  • 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 and refunds are recorded against the subscription and should reduce the reported figure.

Written guarantee

95%+ tracking accuracy

Measured against MemberPress transactions and subscriptions in your own WordPress database, for the same window.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

MemberPress → PostHog questions, answered

The WordPress user ID, set with identify on the first logged-in page and reused on server events.

Free · 30 min

Get MemberPress and PostHog joined properly

Free30 minutesNo obligation