Skip to main content
Firebase Auth → MatomoIntegration guide

Connecting Firebase Authentication to Matomo

Firebase Auth is usually the identity layer in a mobile-first product, which means the user ID it issues is the only thing connecting a web visit to an in-app purchase. 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 Firebase 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

Firebase Auth to Matomo: the uid as Matomo's User ID

Set Matomo's User ID to the Firebase uid whenever onAuthStateChanged reports a signed-in, non-anonymous user, and pass the same uid when your server posts paid conversions through the HTTP Tracking API. Link anonymous accounts at signup so pre-signup visits stay attached. Test one signup end to end, and check Matomo's app SDK support.

Matomo has a User ID feature, and the Firebase uid is the right value for it: stable, opaque, and identical on web and in the app. Set it in the tracker whenever onAuthStateChanged reports a signed-in, non-anonymous user, and pass the same uid when your server posts paid conversions through the HTTP Tracking API, so the order lands on the same history the browser built.

Anonymous auth decides whether that history is complete. Linking an anonymous account to a real credential keeps the uid, so pre-signup visits and the paying account stay one Matomo user. If signup instead creates a fresh account, the paying user gets a new uid and Matomo shows someone with no acquisition history, which is exactly the gap you installed it to close. Test one signup end to end and look at the visitor log before trusting any funnel.

The self-hosting angle is real for a Firebase product: the uid and the order can go to a Matomo instance on your own domain, untouched by ad blockers, and the raw log is queryable. The in-app side is the weaker half, so check the state of Matomo's SDK for your app platform before promising web and app in one report.

Firebase Auth → Matomo · what breaks

Why this join usually fails — Firebase Auth → Matomo

  1. 01

    The first-party visitor ID never reaches Firebase Auth

    Anonymous authentication creates users before signup, and linking an anonymous account to a real one is a step teams frequently skip.

  2. 02

    Anonymous accounts never linked to real ones

    Firebase's anonymous auth is convenient and creates a separate user. If it is not linked at signup, the pre-signup activity and the paying customer are two different people in every downstream system.

  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.

Firebase Auth → Matomo · the fix

What working looks like — Firebase Auth → 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

    Firebase Authentication's own records are the reference, not either dashboard.

Firebase Auth → Matomo · architecture

How Firebase Auth and Matomo actually connect

  1. 1

    Firebase Authentication holds the truth

    Firebase holds identity, not revenue. Its value to measurement is that it gives a stable key that survives the web-to-app transition where every cookie dies.

  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 Firebase user identity.

  4. 4

    The event source decides reliability

    Send paid conversions keyed on the user identity. Signups and anonymous sessions are stages, 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.

Firebase Auth → Matomo · normal or broken

Working vs. broken, side by side — Firebase Auth → Matomo

Normal, not a fault

  • The first-party visitor ID present on the account

    Visible on the record itself in Firebase Authentication, not merely captured somewhere on the site.

  • Sent from your billing system, keyed on the 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

    Matomo's count and Firebase Authentication's records agree within a few percent over a closed window.

Actually broken

  • The first-party visitor ID missing on most records

    Anonymous authentication creates users before signup, and linking an anonymous account to a real one is a step teams frequently skip.

  • Sent from the browser

    Firebase's anonymous auth is convenient and creates a separate user. If it is not linked at signup, the pre-signup activity and the paying customer are two different people in every downstream system.

  • 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

    The dashboard shows a number and no one has compared it to Firebase Authentication.

Firebase Auth → Matomo · diagnose

Diagnostic order — Firebase Auth → Matomo

  1. 01

    Count accounts carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether anonymous accounts are linked or orphaned at signup

    Orphaned anonymous users are the most common Firebase identity failure and they silently break every cross-signup funnel.

  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.

Firebase Auth → Matomo · prove

How it gets proven — Firebase Auth → Matomo

Against Firebase Authentication's own records, not against either platform's dashboard.

Source of truth

Your billing system, keyed on the Firebase 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 linked user identity against imported conversions.

Firebase Auth → 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 anonymous accounts are linked or orphaned at signup
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

Your billing system, keyed on the Firebase user ID.

Get my free conversion tracking audit

Free30 minutesNo obligation

Firebase Auth → Matomo · when not to buy

When you don't need this — Firebase Auth → Matomo

  • If Matomo already reports conversions that reconcile against Firebase Authentication's records within a few percent, this join is working and there is nothing to buy.
  • Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the first-party visitor ID.
  • If you do not use anonymous auth, the linking problem does not arise.
  • 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.

Firebase Auth → Matomo · what we deliver

What gets built — Firebase Auth → Matomo

  • Identifier capture into Firebase Auth

    Capture the identifier on the web, write it to custom claims or your own user document at first auth, and link anonymous accounts rather than creating duplicates.

  • Event source: your billing system, keyed on the user ID

    Send paid conversions keyed on the user identity. Signups and anonymous sessions are stages, 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, keyed on the Firebase user ID.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Firebase Auth → Matomo questions, answered

Treat it as personal data: it is pseudonymous on its own but links straight to an email in Firebase, so CCPA requests apply. Keeping it in a self-hosted Matomo is what makes handling those requests manageable.

Free · 30 min

Get Firebase Auth and Matomo joined properly

Free30 minutesNo obligation