Connecting Contact Form 7 to Segment
Contact Form 7 is free, everywhere, and stores nothing by default — which is the whole problem. Segment is a customer data platform rather than an ad network, so sending to it is not about matching a conversion — it is about putting one clean event where every other destination can read it. The join between them succeeds or fails on one thing: whether the userId and anonymousId reaches the Contact Form 7 submission before the conversion happens, because Segment can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Contact Form 7 to Segment: one Lead event, anonymousId intact
To send Contact Form 7 leads to Segment, make one server-side track call per stored submission from the wpcf7_mail_sent hook, using the analytics.js anonymousId copied into a hidden field. Put click IDs and UTMs in properties, consent in context, and the submission ID in messageId. Pass email as a trait rather than calling identify.
If Segment is already your pipeline, Contact Form 7 should send exactly one server-side track call per stored submission and let Segment fan it out. The analytics.js snippet on the WordPress site has assigned an anonymousId; copy it into a hidden field and use it on the server call from the wpcf7_mail_sent hook, or Segment records the lead under an identity that has never visited a page.
Click identifiers and UTMs go in as event properties, and consent state goes in the call's context so downstream destinations that need consent can respect it. Use the submission ID as messageId: Contact Form 7 retries and spam resubmits are common, and a duplicate here is a duplicate in every connected tool at once.
Be careful with identify. A form submission tempts people to call identify with the email as userId, but a contact form proves nothing about who someone is, and Segment will merge histories on that claim in every destination. Pass the email as a trait on the track call if a downstream tool needs it, and let your CRM or login system issue the real userId. For a site with one ad platform and no other destinations, posting to that platform directly from the hook is simpler than adding Segment for one form.
Contact Form 7 → Segment · what breaks
Why this join usually fails — Contact Form 7 → Segment
- 01
The userId and anonymousId never reaches Contact Form 7
There is no entries table to write to, so the identifier has to be captured into a hidden field and persisted by whatever you add for storage. Contact Form 7 submits over AJAX, so the page does not reload and anything expecting a navigation event never fires.
- 02
AJAX submission means no page load to hook
Setups that fire a conversion on thank-you-page load simply never fire. Setups that listen for the DOM event miss anyone whose script execution was blocked or deferred.
- 03
One bad event multiplied across every destination
Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.
- 04
Nothing reconciles afterwards
Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.
Contact Form 7 → Segment · the fix
What working looks like — Contact Form 7 → Segment
The userId and anonymousId on every submission
Conversions arriving in Segment
Events land in Segment and forward to every connected destination, warehouse included, on one shared definition.
Reconciled against the source
Contact Form 7 → Segment · architecture
How Contact Form 7 and Segment actually connect
- 1
Contact Form 7 holds the truth
Out of the box Contact Form 7 emails the submission and keeps no record. Before any attribution work is meaningful, submissions have to be stored somewhere queryable. That is step one and it is not optional.
- 2
Segment needs a click to match
Segment needs a consistent identity model — the same userId everywhere, an alias when an anonymous visitor becomes known, and event names that follow one spec. Feeding it inconsistent identities pushes the mess to every connected destination at once.
- 3
The identifier is the bridge
The userId and anonymousId, captured at the visit and carried into the Contact Form 7 submission.
- 4
The event source decides reliability
Fire server-side from PHP. The browser-side wpcf7mailsent DOM event exists and is commonly used, but it depends on the visitor's browser executing correctly and on the AJAX response arriving — the server hook does not.
- 5
Deduplication at the destination
Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.
Contact Form 7 → Segment · normal or broken
Working vs. broken, side by side — Contact Form 7 → Segment
Normal, not a fault
The userId and anonymousId present on the submission
Sent from the wpcf7_mail_sent hook
Deduplicated correctly
Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.
Reconciles with the source
Actually broken
The userId and anonymousId missing on most records
There is no entries table to write to, so the identifier has to be captured into a hidden field and persisted by whatever you add for storage. Contact Form 7 submits over AJAX, so the page does not reload and anything expecting a navigation event never fires.
Sent from the browser
Setups that fire a conversion on thank-you-page load simply never fire. Setups that listen for the DOM event miss anyone whose script execution was blocked or deferred.
Counted twice, or not at all
Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.
Nobody has reconciled it
Contact Form 7 → Segment · diagnose
Diagnostic order — Contact Form 7 → Segment
- 01
Count submissions carrying the userId and anonymousId
- 02
Follow one real conversion end to end
- 03
Confirm submissions are being stored at all
If the only record is an email inbox, there is nothing to reconcile and no way to prove any number. Fix storage before touching attribution.
- 04
Check identity resolution before checking anything downstream
If anonymousId is never aliased to userId, every destination sees two people where there is one, and no downstream fix helps.
- 05
Read the match rate, not the success message
Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.
Contact Form 7 → Segment · prove
How it gets proven — Contact Form 7 → Segment
Source of truth
Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.
- The userId and anonymousId confirmed present on a live submission.
- An anonymous session confirmed aliased to a known user, with the event visible in at least one downstream destination.
- Stored submissions confirmed to match the email record for the same period, before any attribution claim is made.
Contact Form 7 → Segment · free audit
What we check in the free audit
- Count submissions carrying the userId and anonymousId
- Follow one real conversion end to end
- Confirm submissions are being stored at all
- Check identity resolution before checking anything downstream
- Read the match rate, not the success message
Checked against
Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.
Free30 minutesNo obligation
Contact Form 7 → Segment · when not to buy
When you don't need this — Contact Form 7 → Segment
- Measure identifier coverage yourself first — pull your last hundred submissions and count how many carry the userId and anonymousId.
- If you are on Contact Form 7 and serious about attribution, moving to a form plugin that stores entries is often cheaper than working around the one that does not. We will say so rather than bill for the workaround.
- If you send to one or two destinations, Segment is infrastructure you do not need — direct integrations are simpler and cheaper. It earns its place at genuine fan-out.
Contact Form 7 → Segment · what we deliver
What gets built — Contact Form 7 → Segment
Identifier capture into Contact Form 7
Hidden field populated from a first-party cookie, plus a storage layer so the submission and its identifier survive past the email. The wpcf7_before_send_mail hook is where both happen.
Event source: the wpcf7_mail_sent hook
Fire server-side from PHP. The browser-side wpcf7mailsent DOM event exists and is commonly used, but it depends on the visitor's browser executing correctly and on the AJAX response arriving — the server hook does not.
Dispatch to Segment
Server-side track and identify calls with a stable messageId, consistent userId, and the click identifier carried as a trait or property.
Reversals where they exist
Nothing to reverse. Spam filtering before the send is the equivalent concern.
Written guarantee
95%+ tracking accuracy
Measured against Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Contact Form 7 → Segment questions, answered
Send a server-side track call from a Contact Form 7 hook, using the visitor's analytics.js anonymousId passed through a hidden field and the submission ID as messageId. That keeps the lead attached to the browsing session and safe from duplicate retries.
Generally no, because a contact form does not verify identity and identify merges profiles across every destination. Send the email as a trait and let a real login or CRM record supply the userId.
Almost always because the userId and anonymousId never reached the Contact Form 7 submission. There is no entries table to write to, so the identifier has to be captured into a hidden field and persisted by whatever you add for storage. Contact Form 7 submits over AJAX, so the page does not reload and anything expecting a navigation event never fires. Measure coverage before debugging the dispatch.
Segment identifies people by anonymousId before they are known and userId afterwards, and the alias between them is what stitches a session to a customer. Click identifiers travel as event properties or traits rather than as a matching key — Segment does not match anything itself, it forwards. That distinction changes the whole design: get the identity resolution right and every downstream destination inherits it.
The wpcf7_mail_sent hook. Fire server-side from PHP. The browser-side wpcf7mailsent DOM event exists and is commonly used, but it depends on the visitor's browser executing correctly and on the AJAX response arriving — the server hook does not.
Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.
More on Contact Form 7 → Segment
- Contact Form 7 → GA4Connecting Contact Form 7 to GA4
- Contact Form 7 → Google AdsConnecting Contact Form 7 to Google Ads
- Contact Form 7 → MetaConnecting Contact Form 7 to Meta Conversions API
RELATED GUIDES
Where Contact Form 7 → Segment fits in the rest of your tracking
- Formidable Forms → SegmentConnecting Formidable Forms to Segment
- Formstack → SegmentConnecting Formstack to Segment
- WPForms → SegmentConnecting WPForms to Segment
- Contact Form 7 → BigQueryConnecting Contact Form 7 to BigQuery
- Home servicesConversion tracking for home service businesses, measured in completed jobs
- Paperform → SegmentConnecting Paperform to Segment
- Ninja Forms → SegmentConnecting Ninja Forms to Segment
- Jotform → SegmentConnecting Jotform to Segment
Free · 30 min
Get Contact Form 7 and Segment joined properly
Free30 minutesNo obligation
