GA4 and HubSpot: connect website activity to reliable pipeline reporting

Google Analytics 4 (GA4) and HubSpot can connect a campaign visit to a submitted request, a qualified opportunity and a commercial outcome. Adding a Measurement ID only establishes collection. Reliable pipeline reporting also needs preserved campaign context, an evidenced identity link and a deal-level model that prevents associated contacts from multiplying the same deal value.

Jafrin Akter AloLast updated 14 min read
On this page
A pink-topped white form with a checkmark connects by a lime arrow to a checked white folder, beside Connect GA4 and HubSpot.

Start with the question you want answered. “Which landing page loses visitors?” needs different data from “Which acquisition channels created qualified pipeline?” Build the connection around those decisions so you do not pay for a connector that moves the wrong fields.

Which integration jobs must be implemented separately?

Separate page collection, acquisition-field capture and commercial-outcome reporting. They have different owners and acceptance tests.

The first job is collecting GA4 events on pages hosted by HubSpot. HubSpot provides a native setting for this. It installs analytics on your content; it does not, by itself, establish a contact-to-deal reporting model.

The second job is preserving acquisition context in HubSpot. That can involve HubSpot's own tracking, form fields, campaign parameters and a controlled process for retaining first and subsequent touches.

The third job is combining website activity with customer relationship management (CRM) outcomes. You might use a CRM report with captured source fields, a warehouse model, or selected server-side events sent to GA4. Choose the route according to the reporting question and the identifiers you can legitimately retain.

Our CRM and lifecycle implementation service can connect those responsibilities to the contact and deal model. Treat product usage data in HubSpot as another defined input, with its own account mapping and update rules.

For a small team, begin with a verified form submission and a trustworthy deal report. Add individual journey stitching when a real decision requires it. A complicated join with poor coverage can make a report look precise while representing only a small part of the pipeline.

Which system should own each part of the measurement?

Use GA4 for website events, acquisition analysis and behaviour within its measurement limits. CRM records govern the sales workflow. Use HubSpot for contact ownership, qualification, associated companies and deals, and the sales process. Use your billing or finance records for the revenue definition they actually govern.

A closed-won amount might represent contract value, annual recurring value or a sales estimate. It is not automatically cash collected or recognised revenue. Name that measure before displaying it beside advertising spend.

Write a short measurement agreement covering:

  • The eligible request, contact, account or deal population.
  • The event that means a lead was successfully captured.
  • The qualification and opportunity definitions.
  • The acquisition rule and the point at which its value is saved.
  • The report's date boundary, time zone, currency and exclusions.
  • The system and owner responsible for each field.

Keep this with your tracking plan. Otherwise, one team can change “qualified” while another continues presenting the old conversion rate.

How do you install the tags without collecting events twice?

Choose one GA4 installation route for each page type, then verify the rendered page and outgoing events. Adding a second route does not improve the evidence if it repeats the same collection.

For HubSpot-hosted content, open Settings > Content > Pages, choose the relevant domain, open Integrations, enable the GA4 integration and enter the Measurement ID. Domain-specific settings can override defaults. The native integration follows a HubSpot banner requiring opt-in. Header-injected Google code has separate plan prerequisites and is not controlled by that banner by default; configure its consent handling separately. HubSpot's GA4 setup instructions.

Check what is already installed before adding anything. A Measurement ID in HubSpot, the same tag in Google Tag Manager and another copy in a template can all look reasonable when inspected separately. Review the rendered page and requests to establish which route owns collection.

On an externally hosted site, install GA4 through the site's chosen implementation route. HubSpot's tracking code is a separate installation: it is automatic on HubSpot pages but must be added to external pages, with external domains configured appropriately. An embedded HubSpot form can receive submissions without providing full site tracking. HubSpot tracking-code requirements.

Use the GA4 setup guide for a B2B SaaS funnel when defining the website’s event coverage. Verify a known page view in the intended GA4 property, then inspect the successful lead event. Test your consent choices too. The desired result is collection that follows the configured permissions, not maximum event volume under every condition.

Why can GA4 and HubSpot report different acquisition sources?

The tools can be describing different moments or different entities, so compare scope before diagnosing a tracking failure. GA4 has user-, session- and event-scoped traffic-source dimensions. First-user acquisition, the source of a later session and credit assigned to a key event answer different questions. Google's scope definitions.

HubSpot's Original Traffic Source describes the first known interaction source; Latest Traffic Source describes the most recent known source. Record Source explains how the CRM record was created, such as through an import or integration. The traffic-source drill-down fields are system-managed, and manually changing the broad source clears those drill-downs. HubSpot source-property definitions.

Do not rename a GA4 session field “original source” and treat it as equivalent to HubSpot's property. Keep the source system and scope visible in the data dictionary.

For example, an illustrative buyer discovers your site through organic search, returns through an email and later requests a demo after an ad click. An original-acquisition view, a demo-session view and a model that distributes credit across interactions can each produce a different answer. The disagreement is not sufficient evidence of broken tracking.

Investigate comparable records and definitions first. Our attribution model guide explains how the rule changes the question a report answers.

How do campaign parameters reach the HubSpot form?

Pass approved UTM campaign parameters into the intended properties and verify their submitted values. UTM parameters are URL tags used to label acquisition, such as source, medium and campaign.

HubSpot can populate form fields, including hidden fields, from URL query parameters that match the property's internal name. Create the required custom properties, add them to the form, and test the submitted values rather than assuming that the label shown in the editor is the internal name. Query-string population.

A simple acquisition record can include utm_source, utm_medium, utm_campaign, an agreed campaign ID, the landing-page path and the observation time. Add content or term only when someone will use them. Use controlled campaign names so spelling variations do not create separate reporting categories.

Hidden fields capture values available at submission. They do not automatically preserve a campaign from a page visited earlier. HubSpot also warns that pre-population for returning visitors can override hidden-field values depending on the property type. Hidden-field behaviour.

Test this path explicitly: arrive on an article with campaign parameters, navigate to pricing without them, then open the demo form. If your capture depends only on the form page's current URL, the campaign is already gone.

Where permitted by your consent and retention design, preserve the approved acquisition fields across that journey and pass them into the form through a supported mechanism. Record when and where they were observed. Do not copy arbitrary URL parameters, entire form payloads or personal data into an attribution record.

Define three separate behaviours instead of letting one field do everything:

  • First observed acquisition: write once when valid evidence first becomes available, with a timestamp and source.
  • Latest eligible acquisition: update under a documented rule, including how direct visits and missing parameters behave.
  • Conversion context: capture what was known when this specific request was submitted.

These are recommended custom data rules, not a promise about HubSpot's built-in property behaviour. A contact-level field can hold only its current value. Preserve a submission or touch history separately when you need to explain several requests over time.

Avoid clearing a known source just because the next submission lacks UTMs. Equally, do not silently present an old campaign as the current request's source. Retain the observation time and make “unknown for this submission” a valid state.

How do you count a confirmed request as the conversion?

Count the confirmed business request using the form version’s success signal. A button click or generic page load cannot establish that the submission succeeded.

For forms built with HubSpot's updated editor, the documented success event is hs-form-event:on-submission:success. Its form instance application programming interface (API) exposes the form ID and a conversion ID after success. Legacy forms use a different event interface. Current global form events.

Use the relevant success signal for the form version you actually embedded. A submit-button click can occur before validation fails; a generic thank-you-page view can happen on reload or through a bookmarked URL.

Map the successful business action to one deliberate GA4 event, such as a demo-request lead event, then count the confirmed request as a key event when it is a meaningful business outcome. Restrict the trigger to the intended forms. A newsletter signup, support request and sales demo should not all become the same sales conversion because they share an embed library.

Choose one collection path and test repeated callbacks, redirects and repeat submissions. A conversion ID can help your own processing recognise the same submission, but adding an arbitrary ID parameter does not establish universal GA4 deduplication. A second legitimate request should remain distinguishable from a replay of the first.

Inspect both destinations: the form submission and expected contact changes in HubSpot, and the event in GA4. For a custom submission, the HubSpot Forms API guide covers request acceptance, consent context and routing. One can succeed while the other is blocked, misconfigured or sent to a different property.

Use observed identifier relationships for an authorized reporting purpose, and keep the raw contact record in its approved system. HubSpot can associate earlier page views with a contact through its tracking cookie when the visitor identifies themselves. Manually created or imported contacts do not automatically acquire browser history. Server-side form submissions that omit the HubSpot tracking cookie may also fail to connect the visit. HubSpot visitor identification.

A GA4 client ID, a HubSpot tracking cookie, a CRM contact ID and your application's user ID have different meanings. Use the HubSpot tracking-code checks when visits arrive without the expected contact association. Never assume two values identify the same person merely because they were collected near the same time.

If your implementation needs a bridge, store the observed relationship, its timestamp and the permitted use in a controlled location. A browser can have multiple users, and a person can have multiple browsers. Limit the join to evidence you actually have and retain an unmatched category.

Do not send email addresses, phone numbers or form text as ordinary GA4 event parameters, campaign fields or User-IDs. Check page URLs and titles as well. Google’s personally identifiable information (PII) guidance covers those surfaces and describes redaction as a best-effort control, not a substitute for preventing collection. Google Analytics PII guidance.

Keep raw CRM information in the systems authorised to hold it. A hashed email is not a general-purpose workaround for ordinary analytics parameters; any dedicated user-provided-data feature needs its own supported implementation and requirements.

How do you stop contact joins from inflating pipeline value?

Create one accepted row per deal before summing pipeline value. Website events, form submissions, contacts and deals have different row counts. Joining them directly can repeat a deal amount for every associated contact or interaction.

This fictional fixture shows the failure. Values are USD in one reporting period. Deal value is the chosen commercial measure, not a claim about cash received.

How do you stop contact joins from inflating pipeline value?
DealDeal value, USDAssociated contactsValue after raw contact join, USDCorrect deal contribution, USD
D10124,000248,00024,000
D10210,000110,00010,000
D10310,000110,00010,000
Total44,000468,00044,000

SUM(DISTINCT amount) is not the fix. It would return $34,000 because the two separate $10,000 deals have the same amount. Deduplicate by the entity's identifier, not by its price.

SQL is a query language for selecting and aggregating records. For a deliberately simple single-channel report, establish one row per deal and an explicit acquisition-channel snapshot before aggregation. This illustrative SQL uses your own prepared tables, not a HubSpot query endpoint:

SQL
WITH eligible_deals AS (
  SELECT DISTINCT deal_id
  FROM contact_deal_associations
  WHERE is_in_scope = 1
)
SELECT
  COALESCE(d.acquisition_channel, 'Unknown') AS channel,
  COUNT(*) AS won_deals,
  SUM(d.amount_reporting_currency) AS won_deal_value
FROM deals AS d
JOIN eligible_deals AS e ON e.deal_id = d.deal_id
WHERE d.is_closed_won = 1
  AND d.close_date >= '2026-09-01'
  AND d.close_date < '2026-10-01'
GROUP BY COALESCE(d.acquisition_channel, 'Unknown');

The deals table must have one current row per deal, with amounts already converted under your reporting policy. is_in_scope represents a documented contact eligibility rule. This query deliberately excludes deals without an eligible contact association; reconcile those exclusions separately instead of hiding their value.

A multi-touch model needs a different structure: deal-to-touch credit rows whose weights reconcile to the intended allocation for each deal. Do not add the totals from several alternative attribution models together. They are different views of the same outcomes.

HubSpot's native attribution tools distinguish Contact Create, Deal Create and Deal Revenue reports. Deal Create and Deal Revenue attribution require Marketing Hub Enterprise. Their filters and available models matter; the current documentation lists Empirical alongside first touch, last touch, linear and time decay. Confirm reporting access for your purchased package. HubSpot attribution reports.

When should you send a CRM outcome to GA4 server-side?

Sending selected CRM outcomes to GA4 can support specific reporting or advertising uses. It does not remove the need for a CRM or warehouse record of what happened.

For web-stream Measurement Protocol events, Google requires the correct Measurement ID and client ID, with the API secret kept out of browser code. Historical event timestamps have a 72-hour backdating limit. Measurement Protocol event submission.

Session attribution has a separate, tighter requirement: include the session ID, send within 24 hours of that online session's start, and keep an overridden event timestamp within the session. Measurement Protocol use-case requirements.

A deal closing six weeks after a demo cannot be made into an event from the original demo session by copying its session ID. Record the actual close time and choose a supported reporting route. Do not falsify the event timestamp to force attribution.

If the central question is pipeline by original acquisition over a long sales cycle, a maintained CRM or marketing warehouse model is often easier to explain. Preserve the original acquisition evidence, the commercial outcome and the attribution rule as separate inputs.

How do you verify the whole journey before using the report?

Verify a known request through collection, contact matching and the accepted deal total. Use an end-to-end test record, then inspect every transition:

How the workflow fits together
A permitted campaign visit preserves acquisition context, a successful form produces GA4 and HubSpot evidence, verified deal associations create a deal-level outcome, and both paths reconcile before reporting.
Read diagram as text
  • Campaign visit and permitted collection to Preserve acquisition context.
  • Preserve acquisition context to Successful form submission.
  • Successful form submission to GA4 event with approved parameters.
  • Successful form submission to HubSpot contact and submission evidence.
  • HubSpot contact and submission evidence to Qualified deal with verified associations.
  • Qualified deal with verified associations to Deal-level outcome and source snapshot.
  • GA4 event with approved parameters to Reconcile definitions and coverage.
  • Deal-level outcome and source snapshot to Reconcile definitions and coverage.
  • Reconcile definitions and coverage to Publish pipeline report with exclusions
Open full diagram

Test a new visitor, a returning contact, internal navigation before submission, a failed form, a successful redirect, a repeated submission and denied analytics consent. Include a deal with several contacts and a deal with no eligible contact association.

For each case, record the expected source, event count, contact identity, deal treatment and permitted tracking behaviour. If the next destination is Google Ads, verify HubSpot lead capture and conversion reporting separately. Separate product defects from intentional exclusions. A privacy choice or an ineligible support request should not be “repaired” into a sales conversion.

Then monitor coverage: successful eligible submissions, CRM records created or matched, observed acquisition fields, valid deal associations and unmatched outcomes. Report the unknown portion alongside attributed pipeline. A rising unknown share is an investigation signal; replacing it with “Direct” only conceals the problem.

What must pass before the integration is accepted?

Accept the integration only when collection, identity and the deal-level report reconcile under the agreed rules. Use a phased HubSpot implementation plan to assign each checkpoint before expanding the scope.

Checklist

  • The reporting question, commercial measure and entity are explicit.
  • One installation path owns GA4 collection on each page type.
  • HubSpot tracking and form submission behaviour are verified separately.
  • Current URL, preserved acquisition and submission context are distinguished.
  • First-source and latest-source write rules are documented.
  • Form success tracking matches the actual editor and embed version.
  • Personal data is excluded from ordinary GA4 payloads and URLs.
  • Identity links have evidence, permitted use and an unmatched state.
  • Deal amounts reconcile before and after joins and channel allocation.
  • Consent, redirects, retries and returning visitors are tested.
  • Delayed CRM events follow the selected destination's timing rules.
  • Unknown sources and excluded deals remain visible in the report.

If you need help with the collection side, bring a failing journey and expected events to Martechdevs' analytics and tracking service. For CRM source fields, associations and pipeline reporting, use the CRM and lifecycle service. A useful implementation scope should name the test cases and reconciliation results you will receive.

For a second review of the measurement path, get the $99 martech audit. For a defined delivery, request a detailed CRM and lifecycle scope with the source rules, test journeys and deal reconciliation included.

Keep reading

Browse all CRM & Lifecycle guides

Questions people ask

How can we rename campaigns without rewriting historical pipeline?

Keep the captured campaign identifier and observation time unchanged, then maintain a separate mapping to the new reporting label. Version that mapping if stakeholders need to reproduce past reports. Test both old and new identifiers during the transition. Updating a contact’s current campaign field should not silently relabel every earlier request or deal associated with that contact.

Should an internal employee’s demo request enter the sales report?

Only if the report’s population explicitly includes internal tests, which most sales-acquisition reports should separate. Mark approved test submissions and exclude them under a documented rule that also covers the associated deals. Verify that the exclusion works in both systems. Do not delete unexplained records merely to make totals agree; retain enough evidence to distinguish tests from genuine customer requests.

Does attributed pipeline prove that a campaign caused a sale?

No. Attribution applies a rule to observed interactions and commercial outcomes. It does not show what would have happened without the campaign. Use the joined report to explain recorded paths and compare consistent cohorts, while keeping causal claims separate. A controlled experiment or another justified causal method answers a different question from assigning a deal to its captured acquisition source.

Should a failed form-notification email remove the GA4 lead event?

No, if the intended business event was a successfully accepted request. Notification delivery is a separate operating step. Confirm that HubSpot retained the submission and routed it to the required owner, then investigate the notification failure without rewriting the submission as nonexistent. If your actual conversion definition requires a later qualification, track that later result separately from the initial request.

What should happen when sales reopens a closed-won deal?

Apply the report’s stated policy rather than preserving a favourable number by accident. A current-state report should reflect the corrected deal, while a historical snapshot needs an explicit restatement rule. Keep the change time and prior state available for reconciliation. Do not send another revenue event automatically unless the destination’s event meaning and correction mechanism support that action.

Sources

  1. HubSpot: integrate Google Analytics with HubSpot content.
  2. HubSpot: install the tracking code.
  3. Google: traffic-source scopes.
  4. HubSpot: Original and Latest Traffic Source properties.
  5. HubSpot: populate form fields from query strings.
  6. HubSpot: hidden form fields.
  7. HubSpot: global events for the updated forms editor.
  8. HubSpot: visitor identification and tracking.
  9. Google: avoiding PII in Analytics.
  10. HubSpot: attribution report types and models.
  11. Google: sending Measurement Protocol events.
  12. Google: Measurement Protocol use-case requirements.
Portrait of Jafrin Akter Alo

Written by

Jafrin Akter Alo

Data Engineer and Co-founder at Martechdevs and Growth and Analytics Partners

Jafrin writes practical guides to marketing technology, customer data, analytics and AI workflows. Martechdevs is a Growth and Analytics Partners company.

View LinkedIn profile

Book a Free Call

Thirty minutes on your stack and what it needs. Free, and no pitch.

Thirty minutes, and you leave with a plan

We look at what you have, what it is costing you and what to do about it first.

  • 30 minutes
  • Video call, link on booking
  • No obligation

What we'll cover

  • Your current stack and where it hurts
  • Quick wins we can ship first
  • An integration roadmap
  • Timeline, scope and next steps

Calendar not loading? Open it in a new tab or email hello@martechdevs.com.