Connecting Moodle to Mixpanel
Moodle is self-hosted open-source learning management, used mostly by institutions where enrolment and payment are usually two different systems. Mixpanel is a product analytics tool, not an ad platform, which means it has no attribution model of its own and will faithfully report whatever event schema you give it — including a bad one. The join between them succeeds or fails on one thing: whether the distinct_id reaches the Moodle enrolment before the conversion happens, because Mixpanel can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Moodle in Mixpanel: one distinct_id from landing page to completion
Set the distinct_id on your marketing site, carry it into Moodle through a custom profile field at signup, and identify with the Moodle user ID. Send paid enrolment, activity completion and course completion server-side with $insert_id from the Moodle record ID and enrolment method as a property. Agree event names across both systems.
Mixpanel helps a course provider see where paying learners stall: enrolled but never started, started but quit at module three. The trouble is that the funnel spans two systems. The ad click and course page live on a public marketing site running Mixpanel's browser SDK; registration, payment and learning happen in Moodle, often on a subdomain with its own theme, and Moodle has no Mixpanel tracking unless you add it.
Set the distinct_id on the marketing site, carry it into Moodle at signup (a custom profile field works), and identify the learner with the Moodle user ID so anonymous pre-signup visits merge with the account. Single sign-on breaks this: learners arriving through an institutional login never touched your site and appear in Mixpanel only from their first Moodle event. Send paid enrolment, activity completion and course completion server-side through an event observer or scheduled export, with $insert_id from the Moodle record ID.
Agree event names with whoever instruments the marketing site; a Course Purchased from the site and an Enrolment Created from Moodle will otherwise both exist and neither will be trusted. Carry the enrolment method as a property so free enrolments do not inflate conversion rates.
Moodle → Mixpanel · what breaks
Why this join usually fails — Moodle → Mixpanel
- 01
The distinct_id never reaches Moodle
Moodle is typically behind a login and often behind a separate marketing site, so the click identifier has to survive from a public page through registration into a user profile field. Institutional single sign-on frequently breaks that chain entirely.
- 02
Free enrolments outnumbering paid ones
Self-enrolment, cohort sync and manual enrolment all create the same record type as a paid one. Counting them teaches bidding to find people who join free courses.
- 03
One event schema, two teams, no agreement
Marketing names an event Purchase, the product team names it purchase_completed, and both are sent. Mixpanel treats them as unrelated, every funnel silently splits, and two teams spend a quarter arguing about which number is right when both are.
- 04
Nothing reconciles afterwards
Mixpanel shows events in the live view within moments. Check that the distinct_id matches the signed-in user rather than a lingering anonymous ID, because that is the failure that quietly breaks every cross-signup funnel.
Moodle → Mixpanel · the fix
What working looks like — Moodle → Mixpanel
The distinct_id on every enrolment
Conversions arriving in Mixpanel
The event lands on the user profile and becomes available in funnels, retention and cohort analysis.
Reconciled against the source
Moodle → Mixpanel · architecture
How Moodle and Mixpanel actually connect
- 1
Moodle holds the truth
Moodle supports several enrolment methods at once — self-enrolment, manual, cohort sync, payment plugins — and most of them are free. Only the paid methods represent revenue and the others will swamp any blended count.
- 2
Mixpanel needs a click to match
Mixpanel needs a distinct_id, an event name and its properties. Events without a distinct_id are rejected; events with the wrong one land on a stranger's profile.
- 3
The identifier is the bridge
The distinct_id, captured at the visit and carried into the Moodle enrolment.
- 4
The event source decides reliability
Send paid enrolments only, from the server. Free and cohort-synced enrolments must be excluded or the conversion feed is dominated by activity that is not revenue.
- 5
Deduplication at the destination
Mixpanel deduplicates on $insert_id within a time window. Without it, a retried server request creates a second event, and because Mixpanel is where product decisions get made, that inflation ends up in a roadmap rather than in an ad report.
Moodle → Mixpanel · normal or broken
Working vs. broken, side by side — Moodle → Mixpanel
Normal, not a fault
The distinct_id present on the enrolment
Sent from the Moodle enrolment event via a webhook plugin or scheduled export
Deduplicated correctly
Mixpanel deduplicates on $insert_id within a time window. Without it, a retried server request creates a second event, and because Mixpanel is where product decisions get made, that inflation ends up in a roadmap rather than in an ad report.
Reconciles with the source
Actually broken
The distinct_id missing on most records
Moodle is typically behind a login and often behind a separate marketing site, so the click identifier has to survive from a public page through registration into a user profile field. Institutional single sign-on frequently breaks that chain entirely.
Sent from the browser
Self-enrolment, cohort sync and manual enrolment all create the same record type as a paid one. Counting them teaches bidding to find people who join free courses.
Counted twice, or not at all
Marketing names an event Purchase, the product team names it purchase_completed, and both are sent. Mixpanel treats them as unrelated, every funnel silently splits, and two teams spend a quarter arguing about which number is right when both are.
Nobody has reconciled it
Moodle → Mixpanel · diagnose
Diagnostic order — Moodle → Mixpanel
- 01
Count enrolments carrying the distinct_id
- 02
Follow one real conversion end to end
- 03
Break down enrolments by enrolment method
If paid methods are a small minority, that minority is the only thing that should ever reach an ad platform.
- 04
List every event name in the project and look for near-duplicates
Case differences, tense differences and synonyms are the usual finding, and they are cheap to fix before a year of data is built on them.
- 05
Read the match rate, not the success message
Mixpanel shows events in the live view within moments. Check that the distinct_id matches the signed-in user rather than a lingering anonymous ID, because that is the failure that quietly breaks every cross-signup funnel.
Moodle → Mixpanel · prove
How it gets proven — Moodle → Mixpanel
Source of truth
Moodle's enrolment records in your own database, filtered to paid enrolment methods.
- The distinct_id confirmed present on a live enrolment.
- Purchase events reconciled per transaction against your billing system, with identity aliasing verified across the signup boundary.
- Paid enrolments confirmed separated from free and cohort-synced ones before anything is sent.
Moodle → Mixpanel · free audit
What we check in the free audit
- Count enrolments carrying the distinct_id
- Follow one real conversion end to end
- Break down enrolments by enrolment method
- List every event name in the project and look for near-duplicates
- Read the match rate, not the success message
Checked against
Moodle's enrolment records in your own database, filtered to paid enrolment methods.
Free30 minutesNo obligation
Moodle → Mixpanel · when not to buy
When you don't need this — Moodle → Mixpanel
- Measure identifier coverage yourself first — pull your last hundred enrolments and count how many carry the distinct_id.
- If your Moodle is purely internal training with no paid enrolment, there is no conversion here to measure.
- If you already have the same events in a warehouse and nobody is running product analysis on them, adding Mixpanel adds a second source of truth rather than an answer.
Moodle → Mixpanel · what we deliver
What gets built — Moodle → Mixpanel
Identifier capture into Moodle
Capture the identifier on the public site and write it to a Moodle user profile custom field at account creation, so later paid enrolments can be traced back.
Event source: the Moodle enrolment event via a webhook plugin or scheduled export
Send paid enrolments only, from the server. Free and cohort-synced enrolments must be excluded or the conversion feed is dominated by activity that is not revenue.
Dispatch to Mixpanel
The Mixpanel ingestion API, posted server-side from your backend with the distinct_id and event properties.
Reversals where they exist
Un-enrolments and refunds where a payment plugin is used should reduce the reported figure.
Written guarantee
95%+ tracking accuracy
Measured against Moodle's enrolment records in your own database, filtered to paid enrolment methods.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Moodle → Mixpanel questions, answered
Add the browser SDK to your Moodle theme for page-level events or, more reliably, forward Moodle's own events server-side through an observer plugin. Check for an existing plugin compatible with your Moodle version.
The marketing-site distinct_id was never linked to the Moodle user ID at signup, so the anonymous visitor and the learner are separate profiles.
Almost always because the distinct_id never reached the Moodle enrolment. Moodle is typically behind a login and often behind a separate marketing site, so the click identifier has to survive from a public page through registration into a user profile field. Institutional single sign-on frequently breaks that chain entirely. Measure coverage before debugging the dispatch.
Mixpanel identifies people by distinct_id, which starts as an anonymous device value and should be aliased to your own user ID at signup. Getting that alias wrong is the single most common Mixpanel implementation failure: the anonymous pre-signup activity and the identified user become two separate people, and every funnel that crosses signup is broken.
The Moodle enrolment event via a webhook plugin or scheduled export. Send paid enrolments only, from the server. Free and cohort-synced enrolments must be excluded or the conversion feed is dominated by activity that is not revenue.
Mixpanel shows events in the live view within moments. Check that the distinct_id matches the signed-in user rather than a lingering anonymous ID, because that is the failure that quietly breaks every cross-signup funnel.
More on Moodle → Mixpanel
- Moodle → Google AdsConnecting Moodle to Google Ads
- Moodle → MetaConnecting Moodle to Meta Conversions API
- Moodle → GA4Connecting Moodle to GA4
RELATED GUIDES
Where Moodle → Mixpanel fits in the rest of your tracking
- 360Learning → MixpanelConnecting 360Learning to Mixpanel
- Litmos → MixpanelConnecting Litmos to Mixpanel
- LearnWorlds → MixpanelConnecting LearnWorlds to Mixpanel
- Moodle → Adobe AnalyticsConnecting Moodle to Adobe Analytics
- Moodle → MatomoConnecting Moodle to Matomo
- BootcampsConversion tracking for bootcamps, measured in started students
- Tutor LMS → MixpanelConnecting Tutor LMS to Mixpanel
- LearnDash → MixpanelConnecting LearnDash to Mixpanel
Free · 30 min
Get Moodle and Mixpanel joined properly
Free30 minutesNo obligation
