Skip to main content
Twilio → MatomoIntegration guide

Connecting Twilio to Matomo

Twilio is infrastructure rather than a product, so what it can tell you depends entirely on what your own application logged alongside the message or call. 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 Twilio message or call record 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

Twilio to Matomo: tying a phone call back to the visit that caused it

Bind the Matomo visitor ID to a Twilio pool number per session, or send it with a click-to-call form, then post qualified calls to the HTTP Tracking API as goal conversions with the call SID as reference and Twilio's call start time. Small sites can use one number per channel as a channel-level goal.

Matomo's question is which visit produced the call, and Twilio cannot answer it alone. The visit lives in Matomo's first-party cookie; the call lives in Twilio. The join has to be built at the moment the number is shown: either a pool of Twilio numbers assigned per visitor session, where your application records which Matomo visitor ID saw which number and when, or a click-to-call or callback form that sends the visitor ID with the request.

Once your application decides a call qualified, post it to the Matomo HTTP Tracking API with that stored visitor ID as a goal conversion, using the call SID as the reference so a webhook retry does not log it twice. Use the call start time from Twilio, not the time your job ran, or the conversion lands in the wrong day's report. Leave recordings, caller names and transcripts out; Matomo is self-hosted, but it is still an analytics database, not a call archive.

Without a number pool or a callback form there is no honest join, and the usual fallback of crediting every call to the last visit from the same IP is guesswork. The minimal setup for a small site is one tracked number per channel, recorded as a goal against the channel rather than the visitor, which is coarse but true. Self-hosting means nobody else notices if the number pool runs dry and calls stop matching.

Twilio → Matomo · what breaks

Why this join usually fails — Twilio → Matomo

  1. 01

    The first-party visitor ID never reaches Twilio

    Twilio has no concept of marketing at all. Any identifier has to be attached by your own code at the point the interaction is created, and if it was not, the record cannot be recovered afterwards.

  2. 02

    Transport confused with meaning

    A delivered SMS is not a conversion. Twilio reports delivery, and reading that as a business outcome is the standard mistake when teams wire the console directly.

  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.

Twilio → Matomo · the fix

What working looks like — Twilio → Matomo

  • The first-party visitor ID on every interaction

  • 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

Twilio → Matomo · architecture

How Twilio and Matomo actually connect

  1. 1

    Twilio holds the truth

    Twilio knows a message was sent or a call connected. Whether that represented a lead, a booking or a delivery notification is something only your application knows, which makes your own logging the source of truth rather than Twilio's console.

  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 Twilio message or call record.

  4. 4

    The event source decides reliability

    Send from your application when the interaction represents something commercially meaningful, not from Twilio's status callbacks, which report transport rather than outcome.

  5. 5

    Deduplication at the destination

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

Twilio → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the interaction

  • Sent from your application's own event, keyed to the Twilio SID

  • 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

    Twilio has no concept of marketing at all. Any identifier has to be attached by your own code at the point the interaction is created, and if it was not, the record cannot be recovered afterwards.

  • Sent from the browser

    A delivered SMS is not a conversion. Twilio reports delivery, and reading that as a business outcome is the standard mistake when teams wire the console directly.

  • 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

Twilio → Matomo · diagnose

Diagnostic order — Twilio → Matomo

  1. 01

    Count interactions carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether your application logs the business meaning of each interaction

    If it only stores Twilio SIDs and statuses, there is nothing to build a conversion on.

  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.

Twilio → Matomo · prove

How it gets proven — Twilio → Matomo

Source of truth

Your own application's records of Twilio interactions, since Twilio itself stores the transport and not the business meaning.

  • The first-party visitor ID confirmed present on a live interaction.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • Conversions confirmed to come from your application's business events rather than Twilio's delivery callbacks.

Twilio → Matomo · free audit

What we check in the free audit

  • Count interactions carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Check whether your application logs the business meaning of each interaction
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

Your own application's records of Twilio interactions, since Twilio itself stores the transport and not the business meaning.

Get my free conversion tracking audit

Free30 minutesNo obligation

Twilio → Matomo · when not to buy

When you don't need this — Twilio → Matomo

  • Measure identifier coverage yourself first — pull your last hundred interactions and count how many carry the first-party visitor ID.
  • If Twilio is purely notification infrastructure in your stack, it is not a conversion source and should not be treated as one.
  • 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.

Twilio → Matomo · what we deliver

What gets built — Twilio → Matomo

  • Identifier capture into Twilio

    Attach the click identifier in your own application's record when creating the Twilio interaction, and store it alongside the Twilio SID so the two can be joined.

  • Event source: your application's own event, keyed to the Twilio SID

    Send from your application when the interaction represents something commercially meaningful, not from Twilio's status callbacks, which report transport rather than outcome.

  • Dispatch to Matomo

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

  • Reversals where they exist

    Nothing inherent; whatever your application defines as a reversal applies.

Written guarantee

95%+ tracking accuracy

Measured against Your own application's records of Twilio interactions, since Twilio itself stores the transport and not the business meaning.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Twilio → Matomo questions, answered

Yes, if your application stores which Matomo visitor saw which Twilio number, then posts qualified calls through the HTTP Tracking API as goal conversions. Without that stored link, Matomo can only count calls per channel.

Free · 30 min

Get Twilio and Matomo joined properly

Free30 minutesNo obligation