# Integration with google analytics

**URL:** <https://community.hubspot.com/t/integration-with-google-analytics/129829>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [April 13, 2025, 10:44am UTC](https://community.hubspot.com/t/integration-with-google-analytics/129829 "2025-04-13T10:44:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Afshin](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Afshin](https://community.hubspot.com/u/Afshin)\
**Post date:** [April 13, 2025, 10:44am UTC](https://community.hubspot.com/t/integration-with-google-analytics/129829/1 "2025-04-13T10:44:54Z")

</div>

Hi HubSpot Support,

We’ve implemented Google Analytics 4 tracking using gtag() and custom event tracking (e.g., cta\_click) on our HubSpot-hosted website. While the script initializes correctly, we’re seeing the following error in the browser console:

[Report Only] Refused to connect to google analytics because it violates the following Content Security Policy directive: “connect-src ‘none’”.

To ensure tracking works as expected, we need to allow these domains in the connect-src directive of our Content Security Policy:

Do anyone know how to update the CSP configuration for our domain or let us know how we can adjust this ourselves in the HubSpot settings? Using free version.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [April 14, 2025, 8:52am UTC](https://community.hubspot.com/t/integration-with-google-analytics/129829/2 "2025-04-14T08:52:23Z")

</div>

Hi @Afshin and welcome, we are so glad to have you here! 🤗  
Thanks for asking the HubSpot Community!  
I’d like to share these resources on the topic:  
- [SSL and domain security in HubSpot](https://knowledge.hubspot.com/domains-and-urls/ssl-and-domain-security-in-hubspot)  
- [Update your DNS records](https://knowledge.hubspot.com/domains-and-urls/update-your-dns-records)  
I have found for you the solution from @miljkovicmisa on this post “[HubSpot Content Security Policy (CSP) Trust and Safety Issue](https://community.hubspot.com/t5/CMS-Development/HubSpot-Content-Security-Policy-CSP-Trust-and-Safety-Issue/m-p/492612)” that might help you!  
It seems that you need an Enterprise subscription for this though.  
Also, I’d love to ask our Top Experts: Hi @Anton, [@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366) and [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) do you have other suggestions or workaround to help @Afshin, please?  
Have a great day and thanks so much in advance for your help! ⭐  
Bérangère

---

<div class="post-metadata">

**Author:** ![nickdeckerdevs1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nickdeckerdevs1/32/5198_2.png) [@nickdeckerdevs1](https://community.hubspot.com/u/nickdeckerdevs1)\
**Post date:** [April 15, 2025, 7:12pm UTC](https://community.hubspot.com/t/integration-with-google-analytics/129829/3 "2025-04-15T19:12:26Z")

</div>

You need content hub pro/enterprise I believe to update these settings.

> **[SSL and domain security in HubSpot](https://knowledge.hubspot.com/domains-and-urls/ssl-and-domain-security-in-hubspot)**
>
> Learn how to manage SSL and domain security in HubSpot, including SSL provisioning and domain security settings.

---

<div class="post-metadata">

**Author:** ![nickdeckerdevs1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nickdeckerdevs1/32/5198_2.png) [@nickdeckerdevs1](https://community.hubspot.com/u/nickdeckerdevs1)\
**Post date:** [April 16, 2025, 11:33am UTC](https://community.hubspot.com/t/integration-with-google-analytics/129829/4 "2025-04-16T11:33:30Z")

</div>

how technical are you? Do you just need page data sent to ga and not user behavior?

are you using free hubspot because you have another website built?

you could technically create a page to embed in your hubspot site and iframe it. Through this you create a proxy to GA. You have all your code to work with GA on your non hubspot site, and when you iframe it, you set up a pass through and deliver data from hubspot to the iframe - then pass that data to GA.

It’s a work around, user behavior tracking would be very different /limited - bit if you were looking for some specific data it could work

now, that being said, if you aren’t needing custom GA stuff -- are you able to use the GA integration inside settings, content, one of the tabs in there allows you to input a GA integration variable. -- that may load the script differently and work with the CSP, but that is likely a long shot on free, but worth checking imo
