Skip to main content
LearnWorlds → PostHogIntegration guide

Connecting LearnWorlds to PostHog

LearnWorlds is a hosted course platform for creators and small training businesses, with the school on its own domain or subdomain. 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 LearnWorlds enrolment 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

LearnWorlds to PostHog: one distinct_id from course page to completion

To track LearnWorlds in PostHog, use the LearnWorlds user ID as the identified distinct_id and alias the anonymous browser ID at signup. Send lesson progress and completion from webhooks server-side with the same distinct_id, and paid enrollments with an event UUID derived from the order ID. Mark free and paid enrollments distinctly in properties.

PostHog is useful to a LearnWorlds school as a funnel tool: from course sales page to checkout to first lesson to completion, which is where most course revenue is won or refunded. The join is the distinct_id. Use the LearnWorlds user ID as the identified distinct_id and alias the anonymous browser ID to it at signup or login, so pre-signup browsing on the sales page attaches to the learner who later buys.

That requires the PostHog snippet on school pages; check whether your LearnWorlds plan allows custom code there, and on the checkout. Inside the course player you will not be able to instrument freely, so take lesson progress and completion from LearnWorlds webhooks and send them server-side to PostHog with the same distinct_id. A server event keyed on email while the browser uses the user ID creates two people and breaks every funnel.

Send paid enrolments from the order webhook with an event UUID, ideally derived from the LearnWorlds order ID, so a retried delivery does not create a second purchase. Separate free and paid enrolments in event properties; the question PostHog answers well here is whether free-course learners go on to buy, and that only works if the two are distinguishable.

LearnWorlds → PostHog · what breaks

Why this join usually fails — LearnWorlds → PostHog

  1. 01

    The distinct_id never reaches LearnWorlds

    Checkout is hosted, so an identifier captured on a separate marketing site does not reach the enrolment unless carried through the checkout URL and confirmed on the order.

  2. 02

    Free lead-magnet courses counted as conversions

    Free courses are a legitimate lead magnet and a terrible conversion target. Sending them teaches bidding to find people who take free courses.

  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.

LearnWorlds → PostHog · the fix

What working looks like — LearnWorlds → PostHog

  • The distinct_id on every enrolment

  • Conversions arriving in PostHog

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

  • Reconciled against the source

LearnWorlds → PostHog · architecture

How LearnWorlds and PostHog actually connect

  1. 1

    LearnWorlds holds the truth

    LearnWorlds carries one-off courses, bundles and subscriptions side by side. Subscriptions need valuing over their expected life; treating them as one-off sales understates them badly.

  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 LearnWorlds enrolment.

  4. 4

    The event source decides reliability

    Send paid enrolments, distinguishing one-off purchases from subscriptions so each carries the right value.

  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.

LearnWorlds → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the enrolment

  • Sent from the LearnWorlds order webhook

  • 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

    Checkout is hosted, so an identifier captured on a separate marketing site does not reach the enrolment unless carried through the checkout URL and confirmed on the order.

  • Sent from the browser

    Free courses are a legitimate lead magnet and a terrible conversion target. Sending them teaches bidding to find people who take free courses.

  • 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

LearnWorlds → PostHog · diagnose

Diagnostic order — LearnWorlds → PostHog

  1. 01

    Count enrolments carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether free and paid enrolments share a conversion action

    If they do, the free tier is setting your bids.

  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.

LearnWorlds → PostHog · prove

How it gets proven — LearnWorlds → PostHog

Source of truth

LearnWorlds' paid enrolments and subscription records for the same window.

  • The distinct_id confirmed present on a live enrolment.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Paid enrolments confirmed separated from free, with subscriptions at lifetime value.

LearnWorlds → PostHog · free audit

What we check in the free audit

  • Count enrolments carrying the distinct_id
  • Follow one real conversion end to end
  • Check whether free and paid enrolments share a conversion action
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

LearnWorlds' paid enrolments and subscription records for the same window.

Get my free conversion tracking audit

Free30 minutesNo obligation

LearnWorlds → PostHog · when not to buy

When you don't need this — LearnWorlds → PostHog

  • Measure identifier coverage yourself first — pull your last hundred enrolments and count how many carry the distinct_id.
  • If you run one free course as a funnel entry and monetise elsewhere, the conversion is not in LearnWorlds.
  • 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.

LearnWorlds → PostHog · what we deliver

What gets built — LearnWorlds → PostHog

  • Identifier capture into LearnWorlds

    Append the identifier to the course checkout URL and verify it is retrievable from the enrolment record before building anything downstream.

  • Event source: the LearnWorlds order webhook

    Send paid enrolments, distinguishing one-off purchases from subscriptions so each carries the right value.

  • 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

    Refunds within the course refund window are common and should reduce the figure.

Written guarantee

95%+ tracking accuracy

Measured against LearnWorlds' paid enrolments and subscription records for the same window.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

LearnWorlds → PostHog questions, answered

Yes, if your plan lets you add custom code to school pages. Course-player activity is better taken from LearnWorlds webhooks and sent server-side.

Free · 30 min

Get LearnWorlds and PostHog joined properly

Free30 minutesNo obligation