If you see unexpected results when analyzing the trends of the tools, there are several factors that could be causing inconsistencies:
- IP filtering
- Tracking code installation
- Source of sessions
- Cross-domain tracking
- In-app traffic
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 activity 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 your web analytics dashboard.
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. Once a visitor reaches your site, all of their interactions are considered the same visit until the source changes or the session ends (after 30 minutes of inactivity or at midnight — this timeout can be customized within your Google Analytics account settings).
Please note: while HubSpot session numbers can be closely aligned with Google Analytics session numbers, these two numbers are not expected to match exactly.
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.
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.
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.
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.
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, we recommend filtering the IP addresses of any internal users in Google Analytics.