calendar Last updated: 26 August 2026
Data integration
How to's

How to Integrate Google Client ID with a HubSpot Form

Try It Now

Connect your data in 1 minute. Free forever plan

Got insights from this post? Give it a boost by sharing with others!

Integrating Google Client ID with a HubSpot form can be a complex task, especially if you are not a developer. However, with the right guidance and collaboration with a developer, you can achieve this integration successfully. Below is a step-by-step guide detailing how to perform this integration:

Steps for Integration

  1. Create a Hidden Field in HubSpot Form
    • Start by creating a hidden field in your HubSpot form. Name this field “google_client_id.” This field will be used to store the Google Client ID.
  2. Enable GTM’s built-in Client ID variable
    • In your Google Tag Manager container, go to Variables > Built-In Variables > Configure, and enable Client ID under the Utilities section. This reads the value GA4 already assigns to the visitor, no extra code required.
  3. Implement the Script on Your Website
    • Have a developer implement a script on your website using HubSpot’s own onFormReady lifecycle hook, which fires once the form, including one embedded inside an iframe, has fully loaded. Inside that hook, set the hidden field’s value to GTM’s built-in Client ID variable, then trigger a change event so HubSpot’s own form validation registers the new value, a required step that’s easy to miss. It is crucial to review and verify the script with your IT team before implementation to ensure it is correctly set up and secure.

Map the hidden field to a HubSpot contact property

Create a custom contact property in HubSpot (Settings > Properties), note its internal name, and use that exact internal name as the hidden field’s name attribute so the captured value lands on the contact record, not just the form submission.

Once the client ID is stored on the contact record, see our guide on connecting Google Analytics to your CRM for how to send the conversion back to GA4.

Tired of juggling fragmented data? Get started with Windsor.ai today to create a single source of truth

Let us help you automate data integration and AI-driven insights, so you can focus on what matters, growth strategy.
g logo
fb logo
big query data
youtube logo
power logo
looker logo