# Connect Google Analytics and Hubspot

**URL:** <https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024>\
**Category:** Reporting & Analytics\
**Tags:** analytics-tools\
**Created:** [September 20, 2023, 6:22am UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024 "2023-09-20T06:22:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASharma58](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ASharma58](https://community.hubspot.com/u/ASharma58)\
**Post date:** [September 20, 2023, 6:22am UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024/1 "2023-09-20T06:22:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jigar\_Thakker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jigar_thakker/32/63606_2.png) [@Jigar\_Thakker](https://community.hubspot.com/u/Jigar_Thakker)\
**Post date:** [September 20, 2023, 7:52am UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024/2 "2023-09-20T07:52:36Z")

</div>

@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](https://knowledge.hubspot.com/prospects/use-prospects)

Regarding google analytics code you can add the code to HubSpot check this : [Integrate Google Analytics with HubSpot content](https://knowledge.hubspot.com/website-pages/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!

---

<div class="post-metadata">

**Author:** ![ASharma58](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ASharma58](https://community.hubspot.com/u/ASharma58)\
**Post date:** [September 20, 2023, 11:10am UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024/3 "2023-09-20T11:10:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ASharma58](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ASharma58](https://community.hubspot.com/u/ASharma58)\
**Post date:** [September 22, 2023, 12:03pm UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024/4 "2023-09-22T12:03:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TSburv](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@TSburv](https://community.hubspot.com/u/TSburv)\
**Post date:** [January 22, 2025, 3:22pm UTC](https://community.hubspot.com/t/connect-google-analytics-and-hubspot/90024/5 "2025-01-22T15:22:28Z")

</div>

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](https://skyvia.com/connectors/hubspot).

Hope this helps
