Connecting Contact Form 7 to X Ads
Contact Form 7 is free, everywhere, and stores nothing by default — which is the whole problem. 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 Contact Form 7 submission 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
Contact Form 7 to X Ads: twclid through the in-app browser
To send Contact Form 7 leads to X Ads, capture twclid into a first-party cookie as soon as the page loads in X's in-app browser and copy it into a hidden field. Send the Lead server-side from the wpcf7_mail_sent hook with twclid and hashed email, using the stored submission ID as the conversion ID shared with any pixel event.
Most clicks on X ads open in the app's built-in browser, which keeps storage short-lived and separate from the visitor's normal browser. For a Contact Form 7 lead that matters because people on X often tap through, read, and come back later in Safari or Chrome to fill in the form, at which point twclid is gone. Capture twclid into a first-party cookie the moment the landing page loads and copy it into a hidden field, and accept that the cross-browser return visit cannot be joined by click ID.
Send the Lead server-side from the wpcf7_mail_sent hook with twclid and the hashed email, and use the stored submission ID as the conversion ID. If the X pixel also fires on the wpcf7mailsent DOM event, it must carry the same ID; at X's usual lead volumes a broken pair doubling the count looks like a good week rather than a bug.
Judge the result against stored submissions, not against X engagement. Posts that drive replies and quote-posts often send the curious rather than prospects, and a contact form is cheap to submit, so check how many X-attributed leads were real inquiries before scaling anything.
Contact Form 7 → X Ads · what breaks
Why this join usually fails — Contact Form 7 → X Ads
- 01
The twclid click identifier 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
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.
- 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.
Contact Form 7 → X Ads · the fix
What working looks like — Contact Form 7 → X Ads
The twclid click identifier on every submission
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
Contact Form 7 → X Ads · architecture
How Contact Form 7 and X Ads 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
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
The identifier is the bridge
The twclid click identifier, 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
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.
Contact Form 7 → X Ads · normal or broken
Working vs. broken, side by side — Contact Form 7 → X Ads
Normal, not a fault
The twclid click identifier present on the submission
Sent from the wpcf7_mail_sent hook
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
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
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
Contact Form 7 → X Ads · diagnose
Diagnostic order — Contact Form 7 → X Ads
- 01
Count submissions carrying the twclid click identifier
- 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
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.
- 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.
Contact Form 7 → X Ads · prove
How it gets proven — Contact Form 7 → X Ads
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 twclid click identifier confirmed present on a live submission.
- Conversions reconciled per order against imported figures, with deduplication verified on a live test.
- Stored submissions confirmed to match the email record for the same period, before any attribution claim is made.
Contact Form 7 → X Ads · free audit
What we check in the free audit
- Count submissions carrying the twclid click identifier
- Follow one real conversion end to end
- Confirm submissions are being stored at all
- Compare engagement rate against conversion rate by campaign
- 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 → X Ads · when not to buy
When you don't need this — Contact Form 7 → X Ads
- Measure identifier coverage yourself first — pull your last hundred submissions and count how many carry the twclid click identifier.
- 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 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.
Contact Form 7 → X Ads · what we deliver
What gets built — Contact Form 7 → X Ads
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 X Ads
The X Conversions API, posted server-side with the click identifier and hashed customer data.
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 → X Ads questions, answered
Store twclid from the landing URL in a first-party cookie, pass it into the form as a hidden field, and send the conversion server-side through X's Conversions API from a Contact Form 7 hook. Use a shared conversion ID if the X pixel also fires.
Many X users click in the in-app browser and return later in a different browser, which loses twclid, and blocked scripts lose pixel fires. Hashed email on a server-side event recovers some of those matches.
Almost always because the twclid click identifier 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.
X appends twclid to the landing URL and the pixel stores it. It behaves like other click identifiers, with the usual caveat that a large share of X traffic arrives through the in-app browser, where storage is partitioned and short-lived.
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.
Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.
More on Contact Form 7 → X Ads
- Contact Form 7 → Google AdsConnecting Contact Form 7 to Google Ads
- Contact Form 7 → Microsoft AdsConnecting Contact Form 7 to Microsoft Ads
- Contact Form 7 → Apple Search AdsConnecting Contact Form 7 to Apple Search Ads
RELATED GUIDES
Where Contact Form 7 → X Ads fits in the rest of your tracking
- X Ads · Law firmsX Ads conversion tracking for law firms
- X Ads · Home servicesX Ads conversion tracking for home service businesses
- X Ads × CRM DealsHow to reconcile X Ads against your CRM's closed-won deals
- X Ads · Lead magnet → saleHow to track lead magnet to sale for X Ads
- Fluent Forms → X AdsConnecting Fluent Forms to X Ads
- Contact Form 7 → MetaConnecting Contact Form 7 to Meta Conversions API
- Home servicesConversion tracking for home service businesses, measured in completed jobs
- Cognito Forms → X AdsConnecting Cognito Forms to X Ads
Free · 30 min
Get Contact Form 7 and X Ads joined properly
Free30 minutesNo obligation
