Skip to main content
Statamic → X AdsIntegration guide

Connecting Statamic to X Ads

Statamic is a flat-file CMS on Laravel, usually chosen by agencies for content sites where commerce is bolted on rather than central. X is a conversation platform where a large share of engagement is discussion rather than intent, which makes the gap between engagement metrics and conversions unusually wide. The join between them succeeds or fails on one thing: whether the twclid click identifier reaches the Statamic or Laravel order record before the conversion happens, because X Ads can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Statamic leads to X Ads with twclid kept through the form

Read the twclid with JavaScript on landing, since cached Statamic pages run no PHP inside X's in-app browser, and post it with the form. Send the conversion from a Laravel listener with twclid, hashed email and a conversion ID generated in the browser and shared with the X pixel. Map only meaningful forms, never footer newsletter boxes.

For a Statamic site running X ads, the conversion is usually a lead form or a small number of orders, and X volumes on lead campaigns are small enough that every lost or doubled event shows. The twclid lands in the URL, the page is often served from the static cache with no PHP running, and the visitor is likely inside X's in-app browser, so read it with JavaScript straight away and post it with the form.

Send the conversion from the Laravel listener when the submission is saved, with twclid, hashed email and the submission ID as the conversion ID. If the X pixel also fires on submit, give it the same conversion ID, which means generating the ID in the browser and posting it with the form rather than creating it on the server afterwards.

Decide which forms count. A Statamic site often has a newsletter box in the footer, and if it fires the same event as the quote form, X will optimize toward the cheapest signups. Map only the forms that matter, and check static cache query-string handling so ad clicks with unique twclid values are not stored as separate cached pages.

Statamic → X Ads · what breaks

Why this join usually fails — Statamic → X Ads

  1. 01

    The twclid click identifier never reaches Statamic

    Statamic's static caching serves pre-rendered files with no PHP execution at all, which means anything expecting server-side rendering per request simply does not run.

  2. 02

    Static caching bypassing PHP entirely

    Statamic's full static caching serves a file from disk. No PHP runs, so nothing dynamic happens — and this is invisible because the page looks perfect.

  3. 03

    Engagement mistaken for intent

    A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.

  4. 04

    Nothing reconciles afterwards

    Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.

Statamic → X Ads · the fix

What working looks like — Statamic → X Ads

  • The twclid click identifier on every order

  • Conversions arriving in X Ads

    The conversion is matched to a click or an engagement and becomes available for optimisation and reporting.

  • Reconciled against the source

Statamic → X Ads · architecture

How Statamic and X Ads actually connect

  1. 1

    Statamic holds the truth

    Because Statamic sits on Laravel, the commercial record is usually a database table your developers defined. That is the source of truth and it is fully under your control.

  2. 2

    X Ads needs a click to match

    An event X recognises, a conversion identifier for deduplication, hashed customer information, and the click identifier where you have it.

  3. 3

    The identifier is the bridge

    The twclid click identifier, captured at the visit and carried into the Statamic or Laravel order record.

  4. 4

    The event source decides reliability

    Fire from the application event. Static caching means the template that rendered the page may never have executed anything.

  5. 5

    Deduplication at the destination

    X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.

Statamic → X Ads · normal or broken

Working vs. broken, side by side — Statamic → X Ads

Normal, not a fault

  • The twclid click identifier present on the order

  • Sent from your Laravel application's order event

  • Deduplicated correctly

    X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.

  • Reconciles with the source

Actually broken

  • The twclid click identifier missing on most records

    Statamic's static caching serves pre-rendered files with no PHP execution at all, which means anything expecting server-side rendering per request simply does not run.

  • Sent from the browser

    Statamic's full static caching serves a file from disk. No PHP runs, so nothing dynamic happens — and this is invisible because the page looks perfect.

  • Counted twice, or not at all

    A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.

  • Nobody has reconciled it

Statamic → X Ads · diagnose

Diagnostic order — Statamic → X Ads

  1. 01

    Count orders carrying the twclid click identifier

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether full static caching is enabled

    If it is, any per-request logic in a template is not running and never was.

  4. 04

    Compare engagement rate against conversion rate by campaign

    On X the two frequently move in opposite directions, and that divergence is the finding rather than a measurement fault.

  5. 05

    Read the match rate, not the success message

    Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.

Statamic → X Ads · prove

How it gets proven — Statamic → X Ads

Source of truth

Whatever your Laravel application persists — Statamic's flat files hold content, not transactions.

  • The twclid click identifier confirmed present on a live order.
  • Conversions reconciled per order against imported figures, with deduplication verified on a live test.
  • Order data confirmed persisted on a purchase made while full static caching was active.

Statamic → X Ads · free audit

What we check in the free audit

  • Count orders carrying the twclid click identifier
  • Follow one real conversion end to end
  • Check whether full static caching is enabled
  • Compare engagement rate against conversion rate by campaign
  • Read the match rate, not the success message

Checked against

Whatever your Laravel application persists — Statamic's flat files hold content, not transactions.

Get my free conversion tracking audit

Free30 minutesNo obligation

Statamic → X Ads · when not to buy

When you don't need this — Statamic → X Ads

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the twclid click identifier.
  • If commerce lives in a separate system entirely, work there — Statamic is the content layer.
  • If X is a brand and community channel for you rather than a performance one, measure it that way and do not force a conversion pipeline onto it.

Statamic → X Ads · what we deliver

What gets built — Statamic → X Ads

  • Identifier capture into Statamic

    Capture the identifier and persist it through a Laravel event listener into your own order table, entirely outside the static cache path.

  • Event source: your Laravel application's order event

    Fire from the application event. Static caching means the template that rendered the page may never have executed anything.

  • Dispatch to X Ads

    The X Conversions API, posted server-side with the click identifier and hashed customer data.

  • Reversals where they exist

    Whatever your application defines as a refund.

Written guarantee

95%+ tracking accuracy

Measured against Whatever your Laravel application persists — Statamic's flat files hold content, not transactions.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Statamic → X Ads questions, answered

Read twclid with JavaScript, post it in a hidden form field, and send the Lead server-side from a Laravel listener with the submission ID as the conversion ID.

Free · 30 min

Get Statamic and X Ads joined properly

Free30 minutesNo obligation