Connect Google Analytics and Hubspot

I want to view the user’s activity(page views and clicks) before they submitted the demo form that leads to contact creation on Hubspot.

Few solutions I can think of:

  • Sending the Contact’s Record ID to GA4 as user property when user submits the form.
  • Sending the GA4 Client ID to Hubspot when user submits the form.

Is there a better solution to achieve this? Also, are there tools/plugins available to achieve this without a code change.

@ASharma58

You can track your website visitors and their activities in HubSpot if you have installed the HubSpot tracking code on your website correctly check this complete guide here: Track website visits

Regarding google analytics code you can add the code to HubSpot check this : Integrate Google Analytics with HubSpot content

Let me know if you have any follow-up questions.

If my post was helpful in addressing your query, Support the community by indicating it as the solution.

Thanks!

Hi Jigar,

Thanks for quick response.

We had already enabled GA tracking. But it is tracking pageviews only after the form submission. Not before the form submission.

How can we get the pages viewed by the user before submitting the form?

Sorry, just realised that the existing GA intergration already captures the pages visited even before the form submission.

So when the Hubspot JS is loaded on the website, it starts tracking all the visits. And when the user finally submits the form, it pushes all the visits data to the contact created.

Thanks, Jigar.

Hello,

Since you mentioned avoiding code changes, I recommend using a third-party integration platform like Skyvia. Skyvia can help you sync data between GA4 and HubSpot with no-code workflows.

For your specific need, the approach could be:

1. Capturing the GA4 Client ID when a user submits the form. Storing the client ID in a custom property in HubSpot (ga_client_id) using form submissions.

2. Using Skyvia to map and sync the activity data from GA4 to HubSpot contacts, enabling you to view pre-submission user actions. Skyvia allows you to schedule these syncs regularly and configure custom field mappings to ensure the data you need is linked properly. You can read more here.

Hope this helps