Skip to main content
AfterSell → MatomoIntegration guide

Connecting AfterSell to Matomo

AfterSell works through checkout extensions and post-purchase pages, which puts its offers inside Shopify's sandboxed surfaces where your own scripts cannot reach. 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 AfterSell upsell order 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

AfterSell orders in Matomo: one order ID, sent once, final total

Matomo keeps the first order request per order ID, so send the ecommerce order once, server-side through the HTTP Tracking API, after the AfterSell offer is answered. Write the Matomo visitor ID to a cart attribute before checkout and use it on the request. List the accepted offer as its own item with a post-purchase category.

Matomo deduplicates ecommerce orders on the order ID, so with AfterSell the first order request wins. If anything records the order before the post-purchase offer is answered, a later request with the final total and the same ID is ignored, and accepted upsells never appear in Matomo revenue. Send the ecommerce order once, server-side through the HTTP Tracking API, after the offer has been answered.

Matomo's JavaScript tracker cannot run inside Shopify's checkout or post-purchase surfaces, and a Shopify custom pixel runs in a sandboxed frame that may not see your storefront's Matomo cookie. Read the Matomo visitor ID on the storefront, write it to a cart attribute before checkout, and use it on the server request so the order joins the visit that produced it.

List the accepted offer as its own item in the ecommerce items, with a category such as post-purchase, so product reports show what AfterSell sold. If you self-host, the webhook handler must reach the tracker endpoint, and a failure there is silent: compare Matomo's weekly order count with Shopify's and investigate any gap larger than a handful.

AfterSell → Matomo · what breaks

Why this join usually fails — AfterSell → Matomo

  1. 01

    The first-party visitor ID never reaches AfterSell

    Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported.

  2. 02

    Trying to instrument a sandbox

    Time gets spent attempting to observe checkout extension behaviour from the storefront. It cannot be done, by design, and every hour spent on it is an hour not spent on the server-side path that works.

  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.

AfterSell → Matomo · the fix

What working looks like — AfterSell → Matomo

  • The first-party visitor ID on every order

  • 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

AfterSell → Matomo · architecture

How AfterSell and Matomo actually connect

  1. 1

    AfterSell holds the truth

    Checkout UI extensions run sandboxed. Nothing you write can observe them, so the only reliable view of what the customer accepted is the order itself.

  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 AfterSell upsell order.

  4. 4

    The event source decides reliability

    Send the final order total from the webhook, with upsell line items identified.

  5. 5

    Deduplication at the destination

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

AfterSell → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the order

  • Sent from the Shopify order webhook

  • 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

    Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported.

  • Sent from the browser

    Time gets spent attempting to observe checkout extension behaviour from the storefront. It cannot be done, by design, and every hour spent on it is an hour not spent on the server-side path that works.

  • 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

AfterSell → Matomo · diagnose

Diagnostic order — AfterSell → Matomo

  1. 01

    Count orders carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Confirm the conversion is sourced from the order, not from a page

    On modern Shopify checkout there is no supported page-based option left, so this is the only correct architecture.

  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.

AfterSell → Matomo · prove

How it gets proven — AfterSell → Matomo

Source of truth

The final Shopify order total, read from the order record.

  • The first-party visitor ID confirmed present on a live order.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • Final order totals reconciled from the webhook against imported conversions.

AfterSell → Matomo · free audit

What we check in the free audit

  • Count orders carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Confirm the conversion is sourced from the order, not from a page
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

The final Shopify order total, read from the order record.

Get my free conversion tracking audit

Free30 minutesNo obligation

AfterSell → Matomo · when not to buy

When you don't need this — AfterSell → Matomo

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the first-party visitor ID.
  • If your conversions already come from the order webhook, checkout extensions change nothing for you.
  • 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.

AfterSell → Matomo · what we deliver

What gets built — AfterSell → Matomo

  • Identifier capture into AfterSell

    Do not try to instrument the checkout surface. Read the order server-side, which is the supported and more reliable path anyway.

  • Event source: the Shopify order webhook

    Send the final order total from the webhook, with upsell line items identified.

  • Dispatch to Matomo

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

  • Reversals where they exist

    Refunds reverse.

Written guarantee

95%+ tracking accuracy

Measured against The final Shopify order total, read from the order record.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

AfterSell → Matomo questions, answered

Most likely the order was recorded before the upsell was added, and Matomo ignored the later request because the order ID matched. Send the order once, after the offer is answered.

Free · 30 min

Get AfterSell and Matomo joined properly

Free30 minutesNo obligation