HubSpot analytics and Google Analytics don't match
Last updated: January 10, 2024
Available with any of the following subscriptions, except where noted:
Marketing Hub Professional , Enterprise |
Legacy Marketing Hub Basic |
When looking at your results from HubSpot and Google Analytics, it's recommended to focus on the trends between the two systems — not comparing X visits from Google Analytics to Y visits in HubSpot.
Below are example reports from HubSpot and Google Analytics. The overall traffic trends remain consistent, even though the tools do not display the same number of sessions.
If you see unexpected results when analyzing the trends of the tools, there are several factors that could be causing inconsistencies:
Sessions
In HubSpot, sessions encompass a series of analytics activities taken by a visitor to your website. Activities can include page views, CTA clicks, events, and more. A session expires after 30 minutes of inactivity. New sessions begin when a visitor returns to your site after 30 minutes of inactivity or with a new session campaign (e.g., the visitor returns to your site from a different traffic source). You can find sessions data in both your sources report and web analytics dashboard. Sessions are restarted at midnight in the account's timezone. If a user initiates a session at 23.59 and then returns at 00:01 by viewing a page, the previous session ended at midnight, and there has been no visit since then, so this isn't counted as being part of a session.
In Google Analytics, a session is counted anytime someone reaches your site from a referring source within a given time frame. That means that the visitor was on an external site and clicked on a link from a unique source that took them to your site or typed your site into their browser directly. A session will end when there has been more than a 30 minute period of inactivity (depending on the session timeout settings). Sessions are not restarted at midnight or when new campaign parameters are encountered. If a user comes back after a session timeout, it will start a new session.
Please note: while HubSpot session numbers can be closely aligned with Google Analytics session numbers, these two numbers are not expected to match exactly.
IP and bot filtering
To block your own traffic to your website from being counted towards your metrics, analytics packages recommend filtering IP addresses. HubSpot and Google Analytics should block the same IP addresses to ensure that internal traffic is filtered consistently. Learn more about filtering internal traffic in HubSpot and in Google Analytics.
Both HubSpot and Google Analytics also have bot filtering settings. Learn how to turn this on for HubSpot. However, they may detect bots differently, leading to variances in the tracked traffic.
Tracking code installation
If the HubSpot or Google Analytics tracking codes are not installed on the same pages on your site, then the tools will not be recording sessions for the same number of pages. Learn how to install the HubSpot tracking code on non-HubSpot pages (the code is already installed on any pages created in HubSpot). Learn how to install the Google Analytics tracking code on HubSpot pages or on non-HubSpot pages.
Source of sessions
HubSpot measures a session based on the referral domain (google.com, facebook.com, cnn.com, etc.) that brings a visitor to your site. Google Analytics measures a session based on the referral source/medium (google/organic, direct/none, facebook/referral) that brings a visitor to your site. This will result in some interactions counting as separate sessions in one tool, but a single session in the other.
HubSpot also segments metrics differently from Google Analytics. HubSpot's sources are different from Google Analytics' channel groupings. For example, HubSpot buckets metrics from Google Ads into Paid Search, while Google Analytics can bucket metrics from Google Ads into either Paid Search, Video, Social, Cross-network or Display, depending on the ad. Also, in HubSpot, if the source of a visitor's session changes due to them interacting with an ad, cta, link in an email etc., a new session will be created.
Cross-domain tracking
Cross domain tracking allows you to aggregate analytics across multiple tracked domains. If a visitor clicks on a link to visit domain1.com and then clicks on a link to visit domain2.com, cross-domain tracking ensures that the interaction is counted as the same session. Without cross-domain tracking, most analytics packages would consider this interaction as two separate sessions because the referral domain/source changes. If HubSpot and Google Analytics do not have the same domains enabled for cross-domain tracking, then the tools will not report consistent sessions. Learn how to enable cross-domain tracking in HubSpot and in Google Analytics.
Please note: Google Analytics may require a more advanced setup for cross-domain tracking, which is not supported by HubSpot Support; contact your web developer or use Google's support forum for additional information.
In-app traffic
The HubSpot tracking code is automatically prevented from firing on preview pages within your HubSpot tools (e.g., https://preview.hs-sites.com/_hcms/preview/content/...) or content editors (i.e., anything on the domain app.hubspot.com). This is to ensure that sessions and page views are not counted during testing and content creation.
However, because the Google Analytics tracking code is added to the header HTML of a HubSpot page, it may count sessions to these in-app pages. If you see results in Google Analytics with referrals from the above URLs, then you may see more sessions in Google Analytics than HubSpot. To prevent preview pages from counting in Google Analytics, it's recommended to filter the IP addresses of any internal users in Google Analytics.
Cookie consent banner
If you have a cookie consent banner banner that requires opt-in, it could affect the number of sessions and views tracked. For example, if the Google Analytics code is added to the Integration tab in your HubSpot settings and a visitor visits a HubSpot-hosted page and declines the cookie banner, HubSpot still counts an anonymous view, but the Google Analytics script will not be loaded and a view will not be counted in Google Analytics.