Reports

Why do HubSpot and Google Analytics not match?

Last updated: August 11, 2017

Available For:

Marketing: Basic, Pro, Enterprise
Sales: N/A
When looking at your results from HubSpot and Google Analytics, we recommend focusing 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 visits.

HubSpot Analytics:

HubSpot Visits Overview
HubSpot Visits Overview

Google Analytics:

Google Analytics Overview
Google Analytics Overview

Reasons HubSpot and Google Analytics may not match

If you see unexpected results when analyzing the trends of the tools, there are several factors that could be causing inconsistencies.

Visits

In Hubspot, a visit is counted anytime someone reaches your site from a referring domain outside of your website domain. That means that the visitor was on an external site and clicked on a link that took them to your site, clicked on a link in an email client, or typed your site into their browser directly. For example, if someone clicks on a link from a Twitter post to visit your site, the referring domain is twitter.com.

In Google Analytics, a visit (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. Once a visitor reaches your site, all of their interactions are considered the same visit until the session ends (after 30 minutes of inactivity or at midnight) or the source changes. If someone clicks on a link from a Twitter post to visit your site, the referring source is twitter. Learn more about Sessions below.

IP Filtering

To block your visits 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.

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 visits 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.

Sessions

Google Analytics uses sessions instead of visits. In Google Analytics, a session ends after 30 minutes of inactivity or at midnight (this is the default timeout in Google Analytics, but it can be customized within the account settings). When comparing these numbers to the visits metrics in HubSpot, you may see discrepancies. You can learn more about the difference between visits and sessions here. 

Example: A visitor leaves a page on your site open in their browser and after a 45 minute break, navigates from that page onto another page on your site. HubSpot counts this interaction as 1 visit (no session timeout). Google Analytics counts this interaction as 2 visits (first session expired and a new session began).

While many analytics in HubSpot are based on visits (see above), HubSpot does include sessions data in the Web Analytics Dashboard. However, if you have the Notify visitors that your site uses cookies and allow opt-out setting enabled, visitors who opt out of cookies will not be tracked across page views and each new page view will be considered a new session. This may result in more sessions in HubSpot.

Please note: While HubSpot session numbers can be more aligned with Google Analytics session numbers (than HubSpot visits numbers will be), these two numbers are not expected to match exactly.

Source of Visits

HubSpot measures a visit based on the referral domain (google.com, facebook.com, cnn.com, etc) that brings a visitor to your site. Google Analytics measures a visit 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 visits in one tool, but a single visit in the other.

Example: A visitor does a Google search and clicks on a search result that brings them to your site. Then, they click back in their browser to see the search results again. This time, they click on a different link to another page on your site. HubSpot considers this interaction to be 2 visits because each page was visited via a non-internal referral domain (google.com and google.com). Google Analytics considers this interaction 1 visit because the referral source/medium remained constant (google/organic and google/organic).

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 visit. Without cross-domain tracking, most analytics packages would consider this interaction as two separate visits 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 visits. Learn how to enable cross-domain tracking in HubSpot and in Google Analytics. 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

HubSpot automatically prevents the HubSpot tracking code from firing on preview pages within our tools (ex. "https://preview.hs-sites.com/_hcms/preview/content/...") or content editors (ex. anything on the domain "app.hubspot.com"). This is to ensure that visits 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 visits to these in-app pages. If you see results in Google Analytics with referrals from the above URLs, then you may see more visits in Google Analytics than HubSpot. To prevent visits to preview pages from counting in Google Analytics, we recommend filtering the IP addresses of any internal users in Google Analytics.

Examples:

Example 1:

A visitor does a Google search for "inbound marketing products" and clicks on a search result to view the page http://www.hubspot.com/inbound-marketing.

  • HubSpot = 1 visit - The visitor reached the site by clicking on a link from an external domain (google.com) outside of HubSpot's domain.
  • Google Analytics = 1 visit - The visitor reached the site by clicking on a link from an external source (google/organic).

Example 2:

A visitor does a Google search for "inbound marketing products" and clicks on a search result to view http://www.hubspot.com/inbound-marketing. After viewing this page, they click back in their browser to see the previous Google search results. Then, they click on another search result to view http://www.hubspot.com/products.

  • HubSpot = 2 visits - The visitor reached the site by clicking on a link from an external domain (google.com) to view the page http://www.hubspot.com/inbound-marketing. This counts as 1 visit. Then, the visitor went back to the external domain (google.com) and clicked on another link to view http://www.hubspot.com/products. This also counts as 1 visit. In total, this interaction resulted in 2 visits recorded by HubSpot.
  • Google Analytics = 1 visit -  The visitor reached the site by clicking on a link from an external source (google/organic) to view the page http://www.hubspot.com/inbound-marketing. This counts as 1 visit. When the visitor goes back in their browser and clicks on a different result, http://www.hubspot.com/products, Google Analytics considers the second interaction to be from the same source/medium as the first interaction. Google Analytics uses "sessions" to measure visits and will not count a new session if the external source/medium does not change. This means that all of these interactions are part of the same visit, so only 1 visit is recorded by Google Analytics.

Example 3:

A visitor clicks on a link from a post on HubSpot's Facebook page to view http://blog.hubspot.com. The visitor then leaves their browser open on this page and goes on their lunch break for 45 minutes. Then, they return to their computer and click on a specific blog post, http://blog.hubspot.com/marketing/best-email-subject-lines-list.

  • HubSpot = 1 visit - The visitor reached the site by clicking on a link from an external domain (facebook.com) to view the page http://blog.hubspot.com. This counts as 1 visit. After their lunch break, the user clicks on a different blog post from the page, this does not count as a separate visit because the blog post was viewed from an internal domain.
  • Google Analytics = 2 visits - The visitor reached the site by clicking on a link from an external source (facebook) to view the page http://blog.hubspot.com. This counts as 1 visit. After their lunch break, the user clicks on a different blog post from the page, but the previous session has already timed out after 30 minutes of inactivity. This means that when the visitor clicks on the blog post, a new session/visit began. 2 visits are reported in Google Analytics because the first visit timed-out after 30 minutes of inactivity and a new visit began when they interacted with the site again.

Was this article helpful?