# How to Set Up Google Analytics 4 for HubSpot CMS

> Set up a Google Analytics 4 property, connect it to your HubSpot-hosted website, and verify that data is collecting.

Canonical source: [https://www.thesecondmile.com/blog/how-to-set-up-google-analytics-4-for-hubspot-cms](https://www.thesecondmile.com/blog/how-to-set-up-google-analytics-4-for-hubspot-cms)

Published: 2023-06-27

Last updated: 2026-09-15

Authors: Daniel Hullett

Google Analytics 4 is Google’s current analytics platform. This guide explains how to create a GA4 property and connect it to your HubSpot-hosted website. 

For Google’s setup guidance, see [Set up Analytics for a website and/or app](https://support.google.com/analytics/answer/9304153).

Here are the steps to get GA4 collecting data from your website. 

### Create an Analytics account

Open [Google Analytics](https://analytics.google.com/analytics/web/). For your first account, choose **Start measuring**. For another account, use **Admin > Create > Account**. Skip account creation if you already have the account you need. Create a new account only if this website and/or app belong(s) to a separate business. Provide an account name and configure the data-sharing settings. Click Next to add the first property to the account.

### Create a Google Analytics 4 property

To add a GA4 property, you need the Editor role. In **Admin**, choose **Create > Property**. If you just created the account, continue with the property setup already in progress.

Name the property and select the reporting time zone and currency, which determines the day boundary for your reports.

Note: Choosing a time zone that honors Daylight Savings Time automatically adjusts for time changes. You can use Greenwich Mean Time to avoid DST adjustments. Changing the time zone affects data going forward and may cause flat spots or spikes until Analytics servers process the change.

Click Next to provide information about your business.

Click Next to share your intended use of Google Analytics. Analytics will tailor your default reports.

Click Create and accept the terms of service and data processing amendment for new accounts. You will need to add a data stream to collect data.

### Add a data stream

In **Admin**, open **Data collection and modification > Data streams**, then choose **Add stream**. If you are continuing the new-property setup, proceed to the Web option. 

Select Web then enter your site's URL and create a Stream name. For example: "Your Website (web stream)".

Review the enhanced measurement options and enable the events relevant to your measurement plan. You can adjust individual events after creating the stream. 

Click Create stream to complete this process. 

Continue with the HubSpot installation steps below. 

### Set up data collection

Last but not least, you'll need your Analytics tag installed on your HubSpot CMS site. 

Open your web stream in **Data streams** and copy its **Measurement ID**, which begins with `G-`.

You can use HubSpot’s Measurement ID integration with Marketing Hub Professional or Enterprise. Header HTML is an alternative for eligible subscriptions. Use one installation method for this property to avoid duplicate tracking. 

Login to HubSpot then click the settings gear icon in the main navigation bar.

Go to **Content > Pages**.

Select a domain and choose the default settings for all HubSpot-hosted content or specific domain settings. Then, go to the Integrations tab and check the box to integrate with Google Analytics 4. To disconnect, simply uncheck the box.

Enter the Measurement ID in the **Measurement ID** field. 

_Click Save!_

With this integration, HubSpot runs Google Analytics only after opt-in when your HubSpot privacy settings or consent banner require it. Test using the consent choice you intend to support.

Keep in mind it could take up to 30 minutes for data to start collecting. Check back in with the [Realtime report](https://support.google.com/analytics/answer/9271392) to make sure you're receiving data. 

For header-code installation, follow [HubSpot’s instructions and subscription requirements](https://knowledge.hubspot.com/website-pages/integrate-google-analytics-with-hubspot-content). Code added through header HTML is not controlled by HubSpot’s consent banner by default; configure consent handling before using this method. 

Between HubSpot reports and GA4 you have two powerful resources for making data-informed marketing and sales decisions. At Second Mile, we help our clients leverage this data to continuously optimize their lead generation and conversion efforts. 

Curious about how GA4 and HubSpot can supercharge your marketing?

[![Get in touch](https://no-cache.hubspot.com/cta/default/5570991/interactive-122525168898.png)](/hs/cta/wi/redirect?encryptedPayload=AVxigLLlbV8VoGEbF0uliwVGpRRsuJa1yxnLp%2BlcSqJ%2Bm48S4izaUZ37wpHj3oQohN90BcCf2%2BGg4fCa5FEnRELcyDiYDrkX3Sk5WWGwaYTLZhZ2jyUTmlSmeFO7A0n0E0EvCN2U15SiEwXKBOdttF33rSyeVVII7ancBCVTphTUpdKKO8ngvLv46fM9%2BPUpqCuN41%2FFuvCC&webInteractiveContentId=122525168898&portalId=5570991)
