We frequently get asked why the HubSpot and Google Analytics are so different, and which one is “right”. And our answer is “they’re BOTH right!” This explanatory article comes from the HubSpot Academy.
Both HubSpot and Google Analytics report on the same metric, ‘visits’, but each tool calculates this value differently. The packages use their own rules for determining a visit and should not be compared on a 1 to 1 basis. There is not a predictable difference where one tool always reports higher/lower visits than the other – there are numerous factors that may cause variations in the metrics.
Top FAQs
What is considered a ‘visit’ by HubSpot and Google Analytics?
Analyzing trends between HubSpot and Google Analytics
Structural reasons why HubSpot and Google Analytics do not match
Examples illustrating the similarities and differences between HubSpot and Google Analytics
What is considered a ‘visit’ by HubSpot and Google Analytics?
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 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.
Analyzing trends between HubSpot and Google Analytics
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:
Google Analytics:
Structural reasons why HubSpot and Google Analytics do not match
If you see unexpected results when analyzing the trends of the tools, there are several factors that could be causing inconsistencies.
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.
- Installing the HubSpot tracking code: Learn how to install the HubSpot tracking code on non-HubSpot pages(the code is already installed on any pages created in HubSpot).
- Installing the Google Analytics tracking code: Learn how to install the Google Analytics tracking code onHubSpot pages or on non-HubSpot pages.
Sessions
Google Analytics may report a higher number of visits due to its measurement of visits using sessions. In Google Analytics, a visit will end 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). HubSpot does not use timed sessions.
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/visit expired and a new session/visit began).
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 of the similarities and differences between HubSpot and Google Analytics
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 the page “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 search result to view “http://www.hubspot.com/products”, Google Analytics considers the second interaction to come 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.
So now you know why we say both Google Analytics and HubSpot’s analytics are “right”! Hat tip to the HubSpot Academy for this article. Learn how you can use HubSpot’s analytics to calculate your ROI.