Skip to main content
Gravity Forms → X AdsIntegration guide

Connecting Gravity Forms to X Ads

Gravity Forms stores the entry in your own WordPress database, which makes it one of the easier sources to join correctly. 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 Gravity Forms entry 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

Gravity Forms to X Ads: keep twclid alive past the in-app browser

Store twclid in your own first-party cookie on landing and fill the Gravity Forms hidden field from it with JavaScript at submit, surviving X's in-app browser and cached pages. Send the lead from gform_after_submission with the entry ID as conversion ID, hashed email and twclid, using the same ID on any pixel lead. Check leads actually qualify.

X sends a lot of traffic through its in-app browser, where cookies are short-lived. Gravity Forms adds the caching problem on top. If the twclid only lives in the pixel's cookie and the hidden field is filled by PHP dynamic population, a cached page plus a visitor who comes back later in their regular browser will produce an entry with no twclid. Store twclid in your own first-party cookie on landing and fill the hidden field from it with JavaScript at submit time.

Send the lead from gform_after_submission with the entry ID as the conversion ID, plus the hashed email and the twclid where you have it. If the X pixel also fires a lead on the AJAX confirmation, it has to use the same entry ID. Otherwise each lead counts twice, and on X's usually small lead volumes that looks like a winning campaign.

Then check whether the leads are real. Campaigns that get engagement on X can also bring in curiosity submissions that never qualify. Compare entries per campaign against the ones your team actually contacted before raising budget.

Gravity Forms → X Ads · what breaks

Why this join usually fails — Gravity Forms → X Ads

  1. 01

    The twclid click identifier never reaches Gravity Forms

    The identifier must be written into a hidden field with dynamic population enabled, and that only works if the parameter is on the URL when the page renders. Page caching serves a cached render to the visitor, so the dynamic population never runs — the same caching problem that breaks WooCommerce.

  2. 02

    Dynamic population fails silently under page caching

    The field is configured correctly and still arrives empty, because the visitor was served a cached page rendered for someone else. This is the most common Gravity Forms failure and it looks like nothing is wrong.

  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.

Gravity Forms → X Ads · the fix

What working looks like — Gravity Forms → X Ads

  • The twclid click identifier on every entry

  • 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

Gravity Forms → X Ads · architecture

How Gravity Forms and X Ads actually connect

  1. 1

    Gravity Forms holds the truth

    The entry lives in your database with every field value attached. You can query it, back it up and reconcile against it without depending on any third party, which is a real advantage over hosted form tools.

  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 Gravity Forms entry.

  4. 4

    The event source decides reliability

    Fire server-side from the PHP hook. This runs regardless of caching, AJAX submission, or what the confirmation page does.

  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.

Gravity Forms → X Ads · normal or broken

Working vs. broken, side by side — Gravity Forms → X Ads

Normal, not a fault

  • The twclid click identifier present on the entry

  • Sent from the gform_after_submission 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

    The identifier must be written into a hidden field with dynamic population enabled, and that only works if the parameter is on the URL when the page renders. Page caching serves a cached render to the visitor, so the dynamic population never runs — the same caching problem that breaks WooCommerce.

  • Sent from the browser

    The field is configured correctly and still arrives empty, because the visitor was served a cached page rendered for someone else. This is the most common Gravity Forms failure and it looks like nothing is wrong.

  • 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

Gravity Forms → X Ads · diagnose

Diagnostic order — Gravity Forms → X Ads

  1. 01

    Count entrys carrying the twclid click identifier

  2. 02

    Follow one real conversion end to end

  3. 03

    Submit a test entry through a cached page

    Not through a logged-in admin session, which bypasses the cache. If the hidden field is empty on the cached path and populated on the admin path, caching is your cause.

  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.

Gravity Forms → X Ads · prove

How it gets proven — Gravity Forms → X Ads

Source of truth

The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.

  • The twclid click identifier confirmed present on a live entry.
  • Conversions reconciled per order against imported figures, with deduplication verified on a live test.
  • Entry meta confirmed populated on a submission made from a fully cached page as an anonymous visitor.

Gravity Forms → X Ads · free audit

What we check in the free audit

  • Count entrys carrying the twclid click identifier
  • Follow one real conversion end to end
  • Submit a test entry through a cached page
  • Compare engagement rate against conversion rate by campaign
  • Read the match rate, not the success message

Checked against

The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.

Get my free conversion tracking audit

Free30 minutesNo obligation

Gravity Forms → X Ads · when not to buy

When you don't need this — Gravity Forms → X Ads

  • Measure identifier coverage yourself first — pull your last hundred entrys and count how many carry the twclid click identifier.
  • If your site has no caching layer and one form, a developer can wire this in an afternoon. Worth trying before hiring anyone.
  • 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.

Gravity Forms → X Ads · what we deliver

What gets built — Gravity Forms → X Ads

  • Identifier capture into Gravity Forms

    Hidden field with 'allow field to be populated dynamically' enabled and a parameter name set, plus a cookie fallback via a gform filter so the identifier survives a visitor who browsed several pages before converting.

  • Event source: the gform_after_submission hook

    Fire server-side from the PHP hook. This runs regardless of caching, AJAX submission, or what the confirmation page does.

  • 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, though entries marked spam should be excluded from the send.

Written guarantee

95%+ tracking accuracy

Measured against The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Gravity Forms → X Ads questions, answered

Capture twclid on landing into a first-party cookie, fill a hidden field from it at submit, and send the lead server-side from gform_after_submission with the entry ID as the conversion ID.

Free · 30 min

Get Gravity Forms and X Ads joined properly

Free30 minutesNo obligation