Connecting Gravity Forms to PostHog
Gravity Forms stores the entry in your own WordPress database, which makes it one of the easier sources to join correctly. PostHog can be self-hosted, which changes the calculus entirely: the data stays on infrastructure you control, and so does the responsibility for everything that goes wrong with it. The join between them succeeds or fails on one thing: whether the distinct_id reaches the Gravity Forms entry before the conversion happens, because PostHog can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Gravity Forms submissions in PostHog on the same distinct_id
Read PostHog's distinct_id into a hidden field at submit, send the event from the submission hook with that ID, then identify to the email. Track each multi-page form page from the browser with the page-change event and the final submission server-side, so funnels show where people drop off. Don't send message bodies, and queue captures when self-hosting.
PostHog is useful here only if the form event lands on the same person the browser has been tracking. The PostHog cookie on your site holds the distinct_id; read it into a hidden field at submit and send the event from the submission hook with that ID, then alias or identify to the email so later sessions on other devices join the same person. Without the hidden field, a server-side capture creates a new person with one event and no funnel.
Send the Gravity Forms form ID and page number as properties. Multi-page forms are where PostHog earns its keep: capture each page completion from the browser with the form's page-change event and the final submission from the server, and the funnel shows exactly which page loses people. That is information the entries list cannot give you, because abandoned multi-page forms leave no entry unless you run the Partial Entries add-on.
Decide what personal data goes in. PostHog properties are visible to everyone with project access and copied into every export, so send the form ID, campaign parameters and a hashed or internal ID, not the message body of a contact form. If you self-host PostHog on the same box as WordPress, a form spike and an ingestion backlog arrive together; queue the capture call rather than making the submission wait on it.
Gravity Forms → PostHog · what breaks
Why this join usually fails — Gravity Forms → PostHog
- 01
The distinct_id 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.
- 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.
- 03
Self-hosting the analytics and the outage together
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
- 04
Nothing reconciles afterwards
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
Gravity Forms → PostHog · the fix
What working looks like — Gravity Forms → PostHog
The distinct_id on every entry
Conversions arriving in PostHog
The event lands on the person profile and becomes available in insights, funnels and session replay.
Reconciled against the source
Gravity Forms → PostHog · architecture
How Gravity Forms and PostHog actually connect
- 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
PostHog needs a click to match
PostHog needs a distinct_id, an event name and its properties. Self-hosted instances additionally need the ingestion endpoint reachable and the project API key correct, which is a class of failure hosted tools do not have.
- 3
The identifier is the bridge
The distinct_id, captured at the visit and carried into the Gravity Forms entry.
- 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
Deduplication at the destination
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
Gravity Forms → PostHog · normal or broken
Working vs. broken, side by side — Gravity Forms → PostHog
Normal, not a fault
The distinct_id present on the entry
Sent from the gform_after_submission hook
Deduplicated correctly
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
Reconciles with the source
Actually broken
The distinct_id 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
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
Nobody has reconciled it
Gravity Forms → PostHog · diagnose
Diagnostic order — Gravity Forms → PostHog
- 01
Count entrys carrying the distinct_id
- 02
Follow one real conversion end to end
- 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.
- 04
Check ingestion health and disk before debugging any missing event
On self-hosted instances the answer is infrastructure far more often than it is instrumentation.
- 05
Read the match rate, not the success message
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
Gravity Forms → PostHog · prove
How it gets proven — Gravity Forms → PostHog
Source of truth
The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.
- The distinct_id confirmed present on a live entry.
- Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
- Entry meta confirmed populated on a submission made from a fully cached page as an anonymous visitor.
Gravity Forms → PostHog · free audit
What we check in the free audit
- Count entrys carrying the distinct_id
- Follow one real conversion end to end
- Submit a test entry through a cached page
- Check ingestion health and disk before debugging any missing event
- 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.
Free30 minutesNo obligation
Gravity Forms → PostHog · when not to buy
When you don't need this — Gravity Forms → PostHog
- Measure identifier coverage yourself first — pull your last hundred entrys and count how many carry the distinct_id.
- If your site has no caching layer and one form, a developer can wire this in an afternoon. Worth trying before hiring anyone.
- If you have no reason to keep the data on your own infrastructure and no team to run it, the hosted product removes the only real downside of this one.
Gravity Forms → PostHog · what we deliver
What gets built — Gravity Forms → PostHog
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 PostHog
The PostHog capture API, posted server-side from your backend to your own instance or to PostHog Cloud.
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.
From $400 · See packages
FAQ
Gravity Forms → PostHog questions, answered
Pass PostHog's distinct_id from the cookie into a hidden field and send the event server-side with it, then identify by email.
Yes, if you capture each page change in the browser and the final submission server-side, with the form ID as a property.
Almost always because the distinct_id never reached the Gravity Forms entry. 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. Measure coverage before debugging the dispatch.
PostHog identifies by distinct_id with an alias call to merge anonymous and identified users. On a self-hosted instance you also control the ingestion endpoint, which means the identifier survives ad blockers that would kill a third-party pixel — one of the few genuine technical advantages available to a first-party setup.
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.
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
More on Gravity Forms → PostHog
- Gravity Forms → Google AdsConnecting Gravity Forms to Google Ads
- Gravity Forms → MetaConnecting Gravity Forms to Meta Conversions API
- Gravity Forms → GA4Connecting Gravity Forms to GA4
RELATED GUIDES
Where Gravity Forms → PostHog fits in the rest of your tracking
- Formstack → PostHogConnecting Formstack to PostHog
- Formidable Forms → PostHogConnecting Formidable Forms to PostHog
- Typeform → PostHogConnecting Typeform to PostHog
- Gravity Forms → Adobe AnalyticsConnecting Gravity Forms to Adobe Analytics
- Gravity Forms → GA4Connecting Gravity Forms to GA4
- Law firmsConversion tracking for law firms, without sending case details anywhere
- Paperform → PostHogConnecting Paperform to PostHog
- Ninja Forms → PostHogConnecting Ninja Forms to PostHog
Free · 30 min
Get Gravity Forms and PostHog joined properly
Free30 minutesNo obligation
