Skip to main content
Moodle → BigQueryIntegration guide

Connecting Moodle to BigQuery

Moodle is self-hosted open-source learning management, used mostly by institutions where enrolment and payment are usually two different systems. BigQuery has no attribution model, no deduplication rules and no opinion about your data — which makes it the only destination on this site where every number is exactly as good as the query that produced it. The join between them succeeds or fails on one thing: whether whatever join key you decide on reaches the Moodle enrolment before the conversion happens, because BigQuery can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Moodle in BigQuery: paid enrolments joined to campaigns

Load Moodle users (including the click identifier profile field), enrolments with their method, and payment records as raw tables, then join in SQL. Filter to payment-based methods in queries, not at load. Convert Unix epochs to one reporting zone, and snapshot enrolment status so refunds and drops aren't lost.

Moodle keeps everything in its own database, so BigQuery's job is to join three things Moodle stores separately: users, including the custom profile field holding the click identifier captured at signup; enrolments, with their enrolment method; and payments recorded by whichever payment gateway plugin you use. Load them as raw tables on a schedule and do the joining in SQL, rather than exporting a pre-joined report you cannot audit.

The key between user and campaign is that profile field; between enrolment and revenue it is the payment record's link to the enrolment instance and user. Filter to payment-based methods in the query, not at load, so free, manual and cohort-synced enrolments remain countable for engagement reporting. Moodle stores times as Unix epochs; convert them once, explicitly, to one reporting zone, because mixing server-local time with UTC is the standard way a Moodle month ends up off by a day.

Depending on configuration, un-enrolment deletes or suspends rows in Moodle, so snapshot enrolment status rather than overwriting it, or refunds and drops quietly vanish from history. With that table in place, paid enrolments carrying a click identifier can be uploaded to ad platforms in batches, and the share of paid enrolments that arrived through single sign-on with no identifier becomes a measured number.

Moodle → BigQuery · what breaks

Why this join usually fails — Moodle → BigQuery

  1. 01

    Whatever join key you decide on 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.

  2. 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.

  3. 03

    The warehouse quietly disagreeing with every platform

    This is not a bug — it is the point. Your warehouse counts orders; Google counts click-attributed conversions in its window; Meta counts differently again. When the four numbers differ, the warehouse is usually right about revenue and wrong about attribution, and knowing which question you are answering is the whole skill.

  4. 04

    Nothing reconciles afterwards

    BigQuery will not tell you anything is wrong. Verify by querying the table directly against your source system's own totals, and check for duplicate rows on the join key before trusting any aggregate.

Moodle → BigQuery · the fix

What working looks like — Moodle → BigQuery

  • Whatever join key you decide on on every enrolment

  • Conversions arriving in BigQuery

    The row lands in a table you own, joinable to every other table you own, with no window and no expiry.

  • Reconciled against the source

Moodle → BigQuery · architecture

How Moodle and BigQuery actually connect

  1. 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. 2

    BigQuery needs a click to match

    BigQuery needs a schema and consistent types. The failure mode is not rejection, it is silent divergence: a column that arrives as a string in one load and an integer in the next, or a timestamp in the wrong zone, which produces answers that look plausible and are not.

  3. 3

    The identifier is the bridge

    Whatever join key you decide on, captured at the visit and carried into the Moodle enrolment.

  4. 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. 5

    Deduplication at the destination

    Nothing deduplicates for you. Streaming inserts are at-least-once, so a retried load can create duplicate rows, and the only protection is a deduplication step you write and actually run.

Moodle → BigQuery · normal or broken

Working vs. broken, side by side — Moodle → BigQuery

Normal, not a fault

  • Whatever join key you decide on present on the enrolment

  • Sent from the Moodle enrolment event via a webhook plugin or scheduled export

  • Deduplicated correctly

    Nothing deduplicates for you. Streaming inserts are at-least-once, so a retried load can create duplicate rows, and the only protection is a deduplication step you write and actually run.

  • Reconciles with the source

Actually broken

  • Whatever join key you decide on 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

    This is not a bug — it is the point. Your warehouse counts orders; Google counts click-attributed conversions in its window; Meta counts differently again. When the four numbers differ, the warehouse is usually right about revenue and wrong about attribution, and knowing which question you are answering is the whole skill.

  • Nobody has reconciled it

Moodle → BigQuery · diagnose

Diagnostic order — Moodle → BigQuery

  1. 01

    Count enrolments carrying whatever join key you decide on

  2. 02

    Follow one real conversion end to end

  3. 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.

  4. 04

    Reconcile warehouse order counts against each platform for one closed window

    The gaps localize the problem: a gap against all platforms is a collection issue, a gap against one is that platform's window or matching.

  5. 05

    Read the match rate, not the success message

    BigQuery will not tell you anything is wrong. Verify by querying the table directly against your source system's own totals, and check for duplicate rows on the join key before trusting any aggregate.

Moodle → BigQuery · prove

How it gets proven — Moodle → BigQuery

Source of truth

Moodle's enrolment records in your own database, filtered to paid enrolment methods.

  • Whatever join key you decide on confirmed present on a live enrolment.
  • Warehouse order counts and revenue reconciled against the source system for a fully closed window, with duplicates checked on the join key.
  • Paid enrolments confirmed separated from free and cohort-synced ones before anything is sent.

Moodle → BigQuery · free audit

What we check in the free audit

  • Count enrolments carrying whatever join key you decide on
  • Follow one real conversion end to end
  • Break down enrolments by enrolment method
  • Reconcile warehouse order counts against each platform for one closed window
  • Read the match rate, not the success message

Checked against

Moodle's enrolment records in your own database, filtered to paid enrolment methods.

Get my free conversion tracking audit

Free30 minutesNo obligation

Moodle → BigQuery · when not to buy

When you don't need this — Moodle → BigQuery

  • Measure identifier coverage yourself first — pull your last hundred enrolments and count how many carry whatever join key you decide on.
  • If your Moodle is purely internal training with no paid enrolment, there is no conversion here to measure.
  • If you have one store and one ad platform, a warehouse is infrastructure you will maintain for a reconciliation you could do in a spreadsheet.

Moodle → BigQuery · what we deliver

What gets built — Moodle → BigQuery

  • 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 BigQuery

    Streaming inserts or scheduled batch loads from your order system, with the raw event retained alongside whatever you derive from it.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Moodle → BigQuery questions, answered

Replicate the relevant Moodle tables (users, profile data, enrolments, payments) on a schedule, or pull through Moodle web services, then join in BigQuery. Check that your hosting allows database read access.

Free · 30 min

Get Moodle and BigQuery joined properly

Free30 minutesNo obligation