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
-
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.
-
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.
-
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.
Windsor vs Coupler.io

