Connecting Google Analytics to HubSpot
There are several options to consider when adding your Google Analytics tracking code. You can add tracking to the following areas:
- All pages on all domains
- All pages on a specific domain
- A specific blog
- A specific page
The easiest and most recommended approach is the first option—adding tracking to all pages on all domains.
To do this, perform the following steps:
- Go to Settings on the top navigation bar of your HubSpot portal.
- Then, scroll down to the last section on the side menu, Tools.
- Click on Website, then Pages on the left navigation sidebar.
- For the Choose a domain to edit its settings option, choose Default settings for all domains.
- Choose Integrations on the menu that appears below it.
- Then, check the Integrate with Google Analytics box and enter your Google Analytics tracking code, as shown in the following screenshot:
Note
It is important to note that if you have a cookie consent policy operating on your site (which is required by law today in most countries), the Google Analytics script will not load until a user has accepted, and if a visitor does not accept this policy, then Google Analytics will not be tracked for them. This functions only on HubSpot-hosted pages. HubSpot cannot control the Google Analytics script on externally hosted pages.