Skip to main content
Craft → MarketoIntegration guide

Connecting Craft CMS to Marketo

Craft is a developer-oriented CMS, usually built bespoke by an agency, which means the implementation is whatever that agency decided and nothing is standard. Marketo scores leads rather than counting conversions, which means what you send it does not report a number — it changes who your sales team calls tomorrow. The join between them succeeds or fails on one thing: whether the lead record, keyed on email reaches the Craft Commerce order before the conversion happens, because Marketo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Craft CMS to Marketo: Craft forms, Munchkin and duplicate leads

If Craft forms are native Freeform or Formie, pass the _mkto_trk cookie value in a hidden field and associate it with the lead through Marketo's REST API after creation; embedded Marketo forms handle this themselves. Fill UTM and click-ID hidden fields with JavaScript, not cached Twig, and audit every form's email mapping.

On a B2B Craft site the Marketo question is which form does the capturing. If the agency embedded Marketo forms in Twig templates, Marketo creates the lead and associates the Munchkin cookie itself, and Craft is only hosting. If the forms are native Craft forms through Freeform or Formie, the plugin's integration or your own listener has to push the lead to Marketo, and the anonymous browsing history only joins the lead if the Munchkin cookie value goes with it.

For native forms, pass the _mkto_trk cookie value in a hidden field and associate it with the lead through the REST API after the lead is created or updated. Check whether your form plugin's Marketo integration does this; some only map fields. Hidden fields for UTM values and click IDs need filling with JavaScript, because a cached Twig template hands every visitor the values of whoever loaded it first.

Duplicates come from editors. Craft makes it easy to add a new form for each campaign landing page, and each one maps email slightly differently, or not at all. A form posting without an email creates nothing useful, and one posting to a mistyped field creates a lead with no scoring fields set. Audit every active form's mapping, then submit one test per form and read the lead's activity log.

Craft → Marketo · what breaks

Why this join usually fails — Craft → Marketo

  1. 01

    The lead record, keyed on email never reaches Craft

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  2. 02

    Every install is bespoke

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  3. 03

    A scoring threshold crossed by a duplicate

    Unlike an ad platform, a duplicate here has an operational consequence: a lead is marked sales-ready, routed, and called by a person. Doing that on the strength of an event counted twice wastes the most expensive resource in the funnel.

  4. 04

    Nothing reconciles afterwards

    Marketo shows the activity log on the lead record with the resulting score change. Read the lead, not the API response, and verify no duplicate lead was created.

Craft → Marketo · the fix

What working looks like — Craft → Marketo

  • The lead record, keyed on email on every order

  • Conversions arriving in Marketo

    The activity lands on the lead, scoring rules evaluate, and the lead may move into a nurture programme or into the sales queue.

  • Reconciled against the source

    Craft CMS's own records are the reference, not either dashboard.

Craft → Marketo · architecture

How Craft and Marketo actually connect

  1. 1

    Craft CMS holds the truth

    Craft installs are bespoke by nature. Establish how this particular build models a completed order before assuming anything transfers from another Craft site.

  2. 2

    Marketo needs a click to match

    Marketo needs the lead's email and the activity or custom object you are recording, with the fields the scoring rules actually reference. An activity that no scoring rule looks at changes nothing.

  3. 3

    The identifier is the bridge

    The lead record, keyed on email, captured at the visit and carried into the Craft Commerce order.

  4. 4

    The event source decides reliability

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  5. 5

    Deduplication at the destination

    Marketo deduplicates leads on email by default, but activities are not deduplicated. A purchase pushed twice can trigger a scoring rule twice and push a lead over a threshold it should not have crossed.

Craft → Marketo · normal or broken

Working vs. broken, side by side — Craft → Marketo

Normal, not a fault

  • The lead record, keyed on email present on the order

    Visible on the record itself in Craft CMS, not merely captured somewhere on the site.

  • Sent from the Craft Commerce order-complete event

  • Deduplicated correctly

    Marketo deduplicates leads on email by default, but activities are not deduplicated. A purchase pushed twice can trigger a scoring rule twice and push a lead over a threshold it should not have crossed.

  • Reconciles with the source

    Marketo's count and Craft CMS's records agree within a few percent over a closed window.

Actually broken

  • The lead record, keyed on email missing on most records

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  • Sent from the browser

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  • Counted twice, or not at all

    Unlike an ad platform, a duplicate here has an operational consequence: a lead is marked sales-ready, routed, and called by a person. Doing that on the strength of an event counted twice wastes the most expensive resource in the funnel.

  • Nobody has reconciled it

    The dashboard shows a number and no one has compared it to Craft CMS.

Craft → Marketo · diagnose

Diagnostic order — Craft → Marketo

  1. 01

    Count orders carrying the lead record, keyed on email

  2. 02

    Follow one real conversion end to end

  3. 03

    Read how this specific build handles order completion

    Assumptions carried from another Craft project are the main source of wasted time here.

  4. 04

    Check the lead's activity log after a test conversion

    One activity or two, and did the score move by the amount the rule specifies? That is the whole test.

  5. 05

    Read the match rate, not the success message

    Marketo shows the activity log on the lead record with the resulting score change. Read the lead, not the API response, and verify no duplicate lead was created.

Craft → Marketo · prove

How it gets proven — Craft → Marketo

Against Craft CMS's own records, not against either platform's dashboard.

Source of truth

Craft Commerce's order records in your own database, filtered to completed.

  • The lead record, keyed on email confirmed present on a live order.
  • Activities confirmed on single lead records with score changes matching the configured rules, and no duplicate leads created.
  • Order custom field confirmed populated on an order placed as an anonymous visitor through cache.

Craft → Marketo · free audit

What we check in the free audit

  • Count orders carrying the lead record, keyed on email
  • Follow one real conversion end to end
  • Read how this specific build handles order completion
  • Check the lead's activity log after a test conversion
  • Read the match rate, not the success message

Checked against

Craft Commerce's order records in your own database, filtered to completed.

Get my free conversion tracking audit

Free30 minutesNo obligation

Craft → Marketo · when not to buy

When you don't need this — Craft → Marketo

  • If Marketo already reports conversions that reconcile against Craft CMS'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 orders and count how many carry the lead record, keyed on email.
  • If the original agency is still engaged, the fastest path is usually specifying the field and having them add the hook.
  • If your sales team does not act on lead scores, pushing conversions into Marketo produces a tidier database and changes nothing about revenue.

Craft → Marketo · what we deliver

What gets built — Craft → Marketo

  • Identifier capture into Craft

    Capture the identifier and store it as a custom field on the order through a Craft event listener, server-side.

  • Event source: the Craft Commerce order-complete event

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  • Dispatch to Marketo

    The Marketo REST API, posted server-side to create or update the lead and record the activity.

  • Reversals where they exist

    Refunds and cancelled orders are recorded against the order.

Written guarantee

95%+ tracking accuracy

Measured against Craft Commerce's order records in your own database, filtered to completed.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Craft → Marketo questions, answered

Marketo forms embedded in Craft handle lead creation and Munchkin association natively. Native Craft forms give editors more control but need an integration that also passes the Munchkin cookie.

Free · 30 min

Get Craft and Marketo joined properly

Free30 minutesNo obligation