How Can I Setup Google Analytics for my HubSpot Website?

Anabeth McConnell Anabeth McConnell
November 21, 2022   |   5 min read time

Google Analytics is a powerful tool that will allow you to better understand your website traffic. and is beneficial whether you run a large established website, have created a brand new site, or manage a personal blog; it gives you valuable insights so you are able to make data-backed decisions.

While Google Analytics is amazing, However, setting up Google Analytics can be a bit tricky. This post will guide you through setting up Google Analytics for your Hubspot website.

What is HubSpot?

HubSpot is an inbound marketing and sales software that helps companies attract visitors, convert leads, and close customers. It is a cloud-based platform, so all of your data is synced across teams and devices, and updates are instant and automatic.

HubSpot exists to help your whole business function better from the first time a potential customer sees a social media post or blog from you to the emails you send them, to handing them your sales team for their first purchase, to the customer service they receive, and all the way to them promoting your company to their peers.

What is Google Analytics?

Google Analytics, or GA, is a free analytics tool that gives you an in-depth look at your website and/or app performance. It integrates with Google’s marketing and advertising platforms and products, including Google Ads, Search Console, and Looker Studio (formerly Google Data Studio), making it a popular choice for anyone using multiple Google tools.

Currently, there are two versions of Google Analytics: Universal Analytics and GA4. Universal Analytics is the version of Google Analytics you have if you set up your GA account prior to October 2020. GA4 is the latest version of Google Analytics and it has a slightly different User Interface (UI) with upgraded reports, tools, and features.

Google announced in March of 2022 that it would be sunsetting the older version of GA by July 1, 2023. Existing data will still be available after that; however, no new data will be collected. This means that all users of GA3 will need to transition to GA4.

How to Use Google Analytics with HubSpot

While a lot of HubSpot Marketing Hub Professional and Enterprise users rely on HubSpot Analytics reporting instead of using Google Analytics, some insights are easier to get from GA - things like organic search traffic. For Marketing Hub Starter users, GA might be necessary since Starter includes only a standard web analytics dashboard

Step One: Set Up Your Accounts

The first thing you’ll need to do is create a Google Analytics account or sign in to your current account.

Next, you’ll need to set up a HubSpot account if you don’t already have one.

Once you have both of these accounts, you’ll need to follow these steps to connect your accounts:

    • In your HubSpot account, click the Settings icon
    • In the left sidebar menu, navigate to Website > Pages
    • Click the Choose a domain to edit dropdown menu and select the domain to add the code. If you want to add the code to all of your HubSpot-hosted domains, select All domains.
    • In the Tracking integrations section, select the Integrate with Google Analytics 4 checkbox.
    • In the next field, enter your Google Analytics Tracking ID
  • Save and finish

Step Two: Configure Your Settings

Now that your accounts are set up and connected, it’s time to configure your GA4 settings.

If you haven’t already, you’ll want to add the name, URL, and industry of the website you want to track in your Google Analytics account. To do this, follow these steps:

  • In Admin, look at the Account column to make sure that you’ve selected the right account. Then, in the Property column, click Create Property.
  • Enter a name for the property (e.g. “My Business, Inc website) and select the reporting time zone and currency. If a visitor comes to your website on Tuesday in their time zone, but it’s Monday in your time zone, the visit is recorded as having occurred on Monday
  • Click Show advanced options (below the property-setup fields).
  • Turn on the switch for Create a Universal Analytics property.
  • Enter the website URL and select the protocol (http or https)
  • Here, you will choose to create Both a Google Analytics 4 Property and a Universal Analytics property or Only a Universal Analytics property.
  • Click Next and provide information about your business.
  • Click Create
  • Accept the Analytics Terms of Service and the Data Processing Amendment if prompted, and click Finish

Once you’ve created a Property, you’ll then need to add a Data Stream or View to your property.

Note that GA4 no longer uses “Views,” but it instead has “Data Streams” with similar functionality. To add a view to your Universal Analytics account, follow these steps:

  • Sign into Google Analytics
  • Click Admin and navigate to the account and property to which you want to add the view
  • In the View column, click the menu, then click +Create View
  • Select either Website or Mobile App
  • Enter a Name (Use a specific and descriptive name, so you can easily tell what data is in this view when you see the name in a list)
  • Select the Reporting Time Zone
  • Click the toggle ON to create a User ID view. For a reporting view, leave the toggle set to OFF.
  • Click Create View

Next, you’ll need to add your tracking code directly after the <head> tag of your site. When you create a property, you’ll have access to a unique ID for tracking and a global site tag. Using this code is how you’ll be able to collect data in your property.

Then, paste your global site tag right after the opening <head> tag on each site page you plan on measuring.

Step Three: Check that Your Code is Working

It is now time to visit your GA portal to verify your code is working. 

To do this, have your website open in one tab on your computer (or even on your phone) and in another tab, look at your Real-Time reports section in GA4. The report should show at least one visitor to the site - and that’s it!

Step Four: View Your Data

If you want to discover how visitors engage with your website, and which content drives the most engagement and conversions, there are several on-page events and metrics you can track from Google Analytics that will get you started: Sessions and New Sessions It also covers most of the website metrics you need such as visitors, bounce rate, and time on site.

You can do things like:

  • Set Goals - Set up your most important business objectives as goals in GA and track them week over week, month over month.
  • Optimize Your Website According to Real Metrics - Now that you have access to your website metrics, you can now make business decisions based on real data. You will no longer have to make blind decisions based on assumptions since the data is right in front of you.
  • View Real-Time Visitors - You can view real-time visitors on your website. This includes their location, how they got to your website, what page they’re on, etc.
  • View Your Visitor Demographics - One of the great benefits of GA is that you can learn how many users visit your website, their age, their gender, their city, and even their interests

Key Takeaways

Google Analytics proves to be a valuable tool for any business. It gives you tangible data that allow you to better understand your website traffic, so you can grow your business.


How to Perform A Website Audit

Download our Website Audit Guide to help kick off your HubSpot website redesign project!

Download Now ›

website audits cover

Want more? Subscribe Now!

Free Design Assessment