Skip to main content
Auth0 → MatomoIntegration guide

Connecting Auth0 to Matomo

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. Matomo can be self-hosted with no third party in the chain, which makes it the one analytics destination where the data genuinely never leaves infrastructure you control. The join between them succeeds or fails on one thing: whether the first-party visitor ID reaches the Auth0 user identity before the conversion happens, because Matomo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Auth0 user_id in Matomo's User ID, never the email

Set Matomo's User ID to the Auth0 sub, never the email, on every page after the callback. Add the Auth0 or custom login domain to excluded referrers so signups are not credited to your login page. Send paid events from billing through the HTTP Tracking API with the same User ID and an ecommerce order ID.

Matomo's User ID feature is the natural home for the Auth0 user_id: set it on the tracker on the first page after the login callback and on every authenticated page after that. Use the sub claim, never the email. Matomo stores the User ID in its logs and reports, and on a self-hosted instance that makes it personal data in a database your own team has to secure and include in deletion requests.

The login redirect is the specific risk. Coming back from the Auth0 domain can start a new visit with Auth0 as the referrer, which credits your signups to your own login page. Add the Auth0 tenant domain, or your custom login domain, to the website's excluded referrers in Matomo. Also check how your Matomo version treats the visitor ID once a User ID is set, because that decides whether the campaign visit before login and the session after it count as one visitor.

Server-side, send paid events from billing through the HTTP Tracking API with the same User ID and an ecommerce order ID, so revenue lands on the same user without needing a browser. Matomo deduplicates on that order ID, which protects you from webhook retries.

Auth0 → Matomo · what breaks

Why this join usually fails — Auth0 → Matomo

  1. 01

    The first-party visitor 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

    Owning the pipeline means owning the outage

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  4. 04

    Nothing reconciles afterwards

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Auth0 → Matomo · the fix

What working looks like — Auth0 → Matomo

  • The first-party visitor ID on every account

  • Conversions arriving in Matomo

    The event lands in your own database and is queryable directly, including the raw log, which most analytics products do not expose.

  • Reconciled against the source

Auth0 → Matomo · architecture

How Auth0 and Matomo 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

    Matomo needs a click to match

    The site ID, the visitor identifier and the event or ecommerce order. Self-hosted instances additionally need the tracker endpoint reachable and the database keeping up, which hosted tools do not fail at.

  3. 3

    The identifier is the bridge

    The first-party visitor 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

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

Auth0 → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the account

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

  • Deduplicated correctly

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

  • Reconciles with the source

Actually broken

  • The first-party visitor 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 is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  • Nobody has reconciled it

Auth0 → Matomo · diagnose

Diagnostic order — Auth0 → Matomo

  1. 01

    Count accounts carrying the first-party visitor 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 tracker reachability and database lag before debugging any tag

    On self-hosted analytics the answer is infrastructure more often than instrumentation.

  5. 05

    Read the match rate, not the success message

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Auth0 → Matomo · prove

How it gets proven — Auth0 → Matomo

Source of truth

Your billing system, joined to the Auth0 user ID.

  • The first-party visitor ID confirmed present on a live account.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • Paid conversions reconciled per user identity against imported conversions, with identifier survival verified across login.

Auth0 → Matomo · free audit

What we check in the free audit

  • Count accounts carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Check whether the identifier survives the login round trip
  • Check tracker reachability and database lag before debugging any tag
  • 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 → Matomo · when not to buy

When you don't need this — Auth0 → Matomo

  • Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the first-party visitor 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 privacy or ownership requirement and no team to run it, a hosted product removes the only real cost of this one.

Auth0 → Matomo · what we deliver

What gets built — Auth0 → Matomo

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

    The Matomo HTTP Tracking API, posted server-side from your order system.

  • 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 → Matomo questions, answered

Users return from the Auth0 login domain, which starts a referral visit. Add that domain to the website's excluded referrers.

Free · 30 min

Get Auth0 and Matomo joined properly

Free30 minutesNo obligation