Skip to main content
Contentful → MatomoIntegration guide

Connecting Contentful to Matomo

Contentful is headless content only — it has no checkout, no orders and no customers, which is the single most important thing to establish before anyone quotes for work. 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 front-end conversion, not a Contentful 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

Contentful and Matomo: content tracking, SPA routes, own-server orders

On a Contentful site, Matomo tracks content by carrying the entry ID and content type as custom dimensions, with a custom URL and pageview on every route change. Conversions come from the order or lead system through the HTTP Tracking API with an order ID and the Matomo visitor ID read from the first-party cookie.

Matomo on a Contentful site has two separate jobs that people tend to merge. The first is content measurement, which Contentful sites genuinely need: which articles, landing pages and components lead somewhere. Matomo's content tracking and custom dimensions can carry the Contentful entry ID and content type on every pageview, so reports group by entry rather than by URLs that editors rename. The second is the conversion, which comes from whatever system takes the order or the lead, posted through the HTTP Tracking API with an order ID.

The failure that shows up first is single-page navigation. A Next.js or Nuxt front end changes routes without reloading, so the Matomo tag records the landing page and then nothing. Set the custom URL and track a pageview on each route change, and reset the content tracking scan after new components render, or Matomo reports one-page sessions on a site where people read five pages.

To tie the server-side order back to the reading session, the backend needs the Matomo visitor ID that the front end set. Read it from the first-party cookie when the order is created and send it with the ecommerce order, otherwise the order lands as a new visitor with no content history attached.

Contentful → Matomo · what breaks

Why this join usually fails — Contentful → Matomo

  1. 01

    The first-party visitor ID never reaches Contentful

    Because Contentful is headless, the front end is a separate application — usually Next.js, Nuxt or similar — and that application is where client-side routing, caching and identifier capture all actually happen. Attributing a tracking problem to Contentful is nearly always a misdiagnosis.

  2. 02

    Blaming the CMS for a front-end problem

    Headless setups fail at the front end — client-side routing that fires one pageview per session, an identifier lost on a route change — and the CMS gets blamed. Contentful is not in that path at all.

  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.

Contentful → Matomo · the fix

What working looks like — Contentful → Matomo

  • The first-party visitor ID on every conversion

  • 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

Contentful → Matomo · architecture

How Contentful and Matomo actually connect

  1. 1

    Contentful holds the truth

    Contentful stores content and serves it via API. The commercial record lives in your commerce platform, your CRM or your billing system, and that is where measurement belongs.

  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 front-end conversion, not a Contentful record.

  4. 4

    The event source decides reliability

    Send from the system that holds the money. Contentful contributes the content layer and nothing to the conversion.

  5. 5

    Deduplication at the destination

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

Contentful → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the conversion

  • Sent from your commerce, CRM or billing system

  • 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

    Because Contentful is headless, the front end is a separate application — usually Next.js, Nuxt or similar — and that application is where client-side routing, caching and identifier capture all actually happen. Attributing a tracking problem to Contentful is nearly always a misdiagnosis.

  • Sent from the browser

    Headless setups fail at the front end — client-side routing that fires one pageview per session, an identifier lost on a route change — and the CMS gets blamed. Contentful is not in that path at all.

  • 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

Contentful → Matomo · diagnose

Diagnostic order — Contentful → Matomo

  1. 01

    Count conversions carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Establish which system holds the conversion before anything else

    In a headless stack it is never the CMS, and starting there wastes the engagement.

  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.

Contentful → Matomo · prove

How it gets proven — Contentful → Matomo

Source of truth

Whatever system takes the money — Contentful holds none of it.

  • The first-party visitor ID confirmed present on a live conversion.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • The conversion confirmed sourced from the commerce or CRM system rather than from anything in the content layer.

Contentful → Matomo · free audit

What we check in the free audit

  • Count conversions carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Establish which system holds the conversion before anything else
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

Whatever system takes the money — Contentful holds none of it.

Get my free conversion tracking audit

Free30 minutesNo obligation

Contentful → Matomo · when not to buy

When you don't need this — Contentful → Matomo

  • Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the first-party visitor ID.
  • There is no Contentful-specific tracking build. The work is in your front-end framework and your commerce system, and we would say so rather than bill for the CMS.
  • 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.

Contentful → Matomo · what we deliver

What gets built — Contentful → Matomo

  • Identifier capture into Contentful

    Capture and persist the identifier in the front-end application, server-side, and carry it into whichever system records the conversion.

  • Event source: your commerce, CRM or billing system

    Send from the system that holds the money. Contentful contributes the content layer and nothing to the conversion.

  • Dispatch to Matomo

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

  • Reversals where they exist

    Handled wherever the money lives.

Written guarantee

95%+ tracking accuracy

Measured against Whatever system takes the money — Contentful holds none of it.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Contentful → Matomo questions, answered

Push the entry ID and content type into Matomo custom dimensions from your front end on each pageview. Slugs change when editors rename pages; entry IDs do not.

Free · 30 min

Get Contentful and Matomo joined properly

Free30 minutesNo obligation