Connecting HubSpot to GA4
HubSpot knows which leads turned into money, weeks after the ad platforms have stopped paying attention. GA4 is where the business goes to understand what happened, which makes an unattributed conversion there expensive in decisions rather than in ad spend. The join between them succeeds or fails on one thing: whether the GA4 client_id reaches the HubSpot contact and deal before the conversion happens, because GA4 can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
HubSpot to GA4: Closed Won deals back on the original user
Fill a hidden HubSpot form field with the GA4 client_id from the _ga cookie and store it on the contact. On Closed Won, a workflow sends amount, currency and that client_id to a server endpoint calling Measurement Protocol with purchase and the deal ID as transaction_id. Decide which associated contact's client_id wins, or revenue lands as direct.
HubSpot's own attribution reports already credit deals to sources through its hubspotutk cookie, so the reason to send deals to GA4 is to see revenue next to the rest of your site analytics, not to replace HubSpot's view. The join is the GA4 client_id: populate a hidden field on the HubSpot form from the _ga cookie and write it to a custom contact property, with session_id alongside if you want the lead itself to join its session.
When a deal reaches Closed Won, a workflow sends the deal amount and currency, plus the associated contact's client_id, to a server endpoint that calls Measurement Protocol with purchase and the deal ID as transaction_id. Whether the 'Send a webhook' workflow action is available depends on your HubSpot subscription, so check before designing around it. Measurement Protocol backdates only 72 hours, so the deal lands on its close date; use user-scoped dimensions like first user source to see which campaign produced it.
The common break: the deal is associated with a company, or with a colleague who never filled the form, so the workflow finds no client_id and GA4 files the revenue under (direct)/(none). Decide which associated contact's property wins. And fire generate_lead for the form from one place only; GA4 will not deduplicate a GTM form trigger and a second script reporting the same submission.
HubSpot → GA4 · what breaks
Why this join usually fails — HubSpot → GA4
- 01
The GA4 client_id never reaches HubSpot
The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again.
- 02
The deal closes long after the click
B2B sales cycles routinely run past the attribution window of every ad platform. Value uploaded on day 95 is value nobody will accept, so the timing question has to be answered before anything is built.
- 03
Everything lands under (direct)/(none)
The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.
- 04
Nothing reconciles afterwards
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
HubSpot → GA4 · the fix
What working looks like — HubSpot → GA4
The GA4 client_id on every deal
Conversions arriving in GA4
Conversions appear in GA4 attributed to the original session's source and medium, so acquisition reporting reflects what actually drove revenue.
Reconciled against the source
HubSpot → GA4 · architecture
How HubSpot and GA4 actually connect
- 1
HubSpot holds the truth
The deal carries the amount, the stage, the close date and the associated contact. That contact is where the original click identifier must live, because the deal is created much later by a salesperson who has no idea an ad was involved.
- 2
GA4 needs a click to match
GA4 needs the client_id to attach a server event to the user and session that produced the click. Without it there is no attribution to inherit and the event is orphaned.
- 3
The identifier is the bridge
The GA4 client_id, captured at the visit and carried into the HubSpot contact and deal.
- 4
The event source decides reliability
Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
- 5
Deduplication at the destination
GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.
HubSpot → GA4 · normal or broken
Working vs. broken, side by side — HubSpot → GA4
Normal, not a fault
The GA4 client_id present on the deal
Sent from a HubSpot workflow or webhook on deal stage change
Deduplicated correctly
GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.
Reconciles with the source
Actually broken
The GA4 client_id missing on most records
The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again.
Sent from the browser
B2B sales cycles routinely run past the attribution window of every ad platform. Value uploaded on day 95 is value nobody will accept, so the timing question has to be answered before anything is built.
Counted twice, or not at all
The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.
Nobody has reconciled it
HubSpot → GA4 · diagnose
Diagnostic order — HubSpot → GA4
- 01
Count deals carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Open a Closed Won deal and follow it back to its contact
Does that contact carry the identifier property, populated? Then check the date gap between the contact's creation and the deal's close — that gap decides whether this integration is possible at all.
- 04
Check whether server events carry a session and a source
In GA4 Realtime or DebugView, find the event and look at its session and traffic source. A brand-new user with no source on every server event is the missing-client_id signature.
- 05
Read the match rate, not the success message
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
HubSpot → GA4 · prove
How it gets proven — HubSpot → GA4
Source of truth
HubSpot's Deals report, filtered to Closed Won for the same window, by close date.
- The GA4 client_id confirmed present on a live deal.
- Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
- The click-to-close time distribution measured, so you know what share of deals close inside the destination's window.
HubSpot → GA4 · free audit
What we check in the free audit
- Count deals carrying the GA4 client_id
- Follow one real conversion end to end
- Open a Closed Won deal and follow it back to its contact
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
HubSpot's Deals report, filtered to Closed Won for the same window, by close date.
Free30 minutesNo obligation
HubSpot → GA4 · when not to buy
When you don't need this — HubSpot → GA4
- Measure identifier coverage yourself first — pull your last hundred deals and count how many carry the GA4 client_id.
- If your median deal closes well past the destination's upload window, the honest answer is a different measurement strategy, not this integration. We will tell you that on the call rather than sell you a build that cannot work.
- GA4 is reporting, not bidding. If your problem is ad platform optimization, fix the ad platform destination first — GA4 will not change what any campaign does.
HubSpot → GA4 · what we deliver
What gets built — HubSpot → GA4
Identifier capture into HubSpot
Create a custom contact property, populate a hidden form field from the persisted first-party cookie, and confirm the property lands on the contact rather than only on the form submission.
Event source: a HubSpot workflow or webhook on deal stage change
Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
Dispatch to GA4
Measurement Protocol events with the client_id, session_id and the correct measurement ID and API secret, sent server-side.
Reversals where they exist
A deal reopened or moved out of Closed Won can be retracted where the destination supports it, though most teams accept the small error here rather than wire it.
Written guarantee
95%+ tracking accuracy
Measured against HubSpot's Deals report, filtered to Closed Won for the same window, by close date.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
HubSpot → GA4 questions, answered
Yes, through Measurement Protocol, triggered by a workflow on deal stage, as long as the contact carries the GA4 client_id captured at form submission. Without it the deal shows up as a new user under (direct)/(none).
Embedded HubSpot forms can't read your page's _ga cookie on their own, so you need a hidden field populated from the cookie and mapped to a contact property.
Almost always because the GA4 client_id never reached the HubSpot contact and deal. The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again. Measure coverage before debugging the dispatch.
The client_id, from the _ga cookie. Measurement Protocol events without it are rejected or create a brand-new user with no session and no source, which is how server events end up filed under (direct)/(none) and make paid channels look worse than they are. Send session_id alongside it so the event joins the existing session, and include engagement_time_msec or the event may not appear as expected in reports.
A HubSpot workflow or webhook on deal stage change. Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
More on HubSpot → GA4
- HubSpot + GoogleGoogle Ads and GA4 tracking for HubSpot
- Stripe → GA4Connecting Stripe to GA4
- Stripe → HubSpotConnecting Stripe to HubSpot
Using HubSpot for bookings? How HubSpot bookings get tracked end to end
RELATED GUIDES
Where HubSpot → GA4 fits in the rest of your tracking
- Nutshell → GA4Connecting Nutshell to GA4
- Salesforce → GA4Connecting Salesforce to GA4
- Zendesk Sell → GA4Connecting Zendesk Sell to GA4
- HubSpot → PostHogConnecting HubSpot to PostHog
- HubSpot → MixpanelConnecting HubSpot to Mixpanel
- Law firmsConversion tracking for law firms, without sending case details anywhere
- Keap → GA4Connecting Keap to GA4
- GoHighLevel → GA4Connecting GoHighLevel to GA4
Free · 30 min
Get HubSpot and GA4 joined properly
Free30 minutesNo obligation
