When comparing the metric for website visits between Google Analytics and HubSpot, you'll find that the numbers reported are inconsistent. This is because each tool calculates the value of a visit differently. The following are some of the main factors that determine website visit metrics for each tool:
Sessions are measured periods of time that a visitor spends engaging with your website during their visit. They include metrics for numerous activities that visitors engage in. Both HubSpot and Google Analytics provide sessions data; however, the way they define the individual sessions of a visitor, and the activities that they engage in, differ.
How Does HubSpot Determine a Session?
Visits are measured by HubSpot based on the referral domain the visitor comes from; for example, Google.com or Facebook.com. Each session takes into account more than just a page view. It also monitors CTA clicks and other events. A session is considered finished once the visitor has been inactive on your website for more than 30 minutes. Once a visitor revisits your website after 30 minutes of inactivity, it will be considered a new session. If a visitor has an adblocker on or has their cookies disabled, HubSpot can often identify sessions by the actions taken by the visitor; for example, if they fill out an opt-in form, then they will know what page the visitor was on and can identify that a session has occurred.
If a visitor engages with one of your web pages and is then distracted for an hour in another window before returning to your site to click on the CTA, HubSpot will consider the total time spent on your site as two separate sessions.
How Does Google Analytics Determine a Session?
Google Analytics measures each visit to your website slightly differently. Instead of measuring each visit based on referral domains, they measure each visit based on referral source/mediums, like Google/organic or Facebook/referral. Like HubSpot, sessions end after 30 minutes of inactivity. However, one session can be counted as two sessions if that single session extends past midnight. This in itself can cause the website visit metrics between the two tools to be different. It's worth noting that you can go into the account settings of Google Analytics to customize session timeouts.
You probably visit your website regularly to check on its performance or to make updates. Your employees may do the same thing. You won't want those sessions to be logged as part of your website visits metrics as they will affect your data and make your analytics less accurate. Fortunately, both Google Analytics and HubSpot offer IP filtering options to help you avoid having your own visits count towards the sessions tracked by both tools.
Are Both Platforms Set to Exclude the Same IP’s?
In HubSpot, you can filter IP addresses by clicking on your Settings icon, choosing Reports>Tracking Code from the left sidebar menu, and going to the Advanced Tracking tab. There, you will see an IP Addresses to Exclude text box where you'll be able to enter your IP address or the IP addresses of any employees that regularly work on your website. You can also exclude referrer domains or IP addresses using the From These Referrers text box.
You can filter your IP address in Google Analytics as well, although the process isn't quite as simple. You will need to create a new View Filter. You'll want to leave this filter as Predefined. You can then select Exclude from the Select Filter Type drop-down menu. Select the Source or Destination tab from the drop-down menu and choose Traffic from the IP Addresses. Click the Select Expression drop-down menu and choose Appropriate Expression. Finally, the last step is to enter the IP address or regular expression.
Tracking Code Installation
In order for sessions to be recorded, you will need to install tracking code for both HubSpot and Google Analytics onto your webpages. If the tracking code for either tool isn't on a specific page, any sessions that occur on that page will not be identified.
Checking for Inconsistencies with Code Deployment
To ensure that your visitor count is being properly tracked by both tools, be sure to have tracking code for both HubSpot and Google Analytics installed on every webpage. If one page has HubSpot tracking code but not Google Analytics tracking code, it means that HubSpot will be measuring sessions that won't show up on Google Analytics, resulting in discrepancies between the two tools' numbers.
If your entire website is hosted on HubSpot, then the tracking code for HubSpot's analytics will be automatically installed. If you aren't using HubSpot or are only using HubSpot for some of your pages, you will need to manually install their tracking code on pages that don't have it. To add HubSpot tracking code to a page, simply click on the Settings icon, go to Reports>Tracking Code, and then click Copy below the Embed Code field. Then paste the code before the </body> tag in the HTML code of each web page on your site.
You can check to see if HubSpot tracking code is installed on a webpage by right-clicking the page and selecting View Page Source or View Source. The HTML code of your site will show up on the following screen. Bring up the search field using the shortcut Ctrl+F or Cmd+F. Then do a search for your HubSpot ID. The tracking code should show up if it's been installed on that page.
To add Google Analytics tracking code, you'll need to obtain the code by going to your Google Analytics account and going to the Property option in the menu. There, you'll find the Tracking Info>Tracking Code option. Your tracking ID and property number will be displayed at the top. You will need to copy and paste the code snippet and add it after the opening <head> tag on each webpage. Some web hosts will have a Tracking ID field found under Admin or Analytics sections where you can add the code so that you don't have to go through your site and manually add it to every page.
Cross-domain tracking is a feature that lets you aggregate analytics across several different tracked domains. For example, if a visitor clicks on a link to one domain then clicks on a link that brings them to another domain, both of which belong to you, then cross-domain tracking ensures that these actions will be counted as one session instead of multiple sessions due to referral domain/source changes.
Is This Configured the Same Across Both Platforms?
You'll want to make sure that cross-domain tracking is set up for both HubSpot and Google Analytics. If it's set up for one tool and not the other, you'll get significant discrepancies in the number of sessions that are identified. Setting up cross-domain tracking for HubSpot is relatively easy. Simply go to the Settings in your HubSpot account and choose Reports>Tracking Code. Click on the Advanced Tracking option and then choose +Add Domain, which should be located at the bottom of the Additional Site Domains table. You'll now be able to add the domains that you want to be included as part of your website for the purpose of cross-domain tracking.
When it comes to measuring your traffic, stick to external traffic. Having your analytics tools count any internal traffic could greatly alter your numbers.
What is In App Traffic?
Internal traffic, or in-app traffic, can occur when you or anyone working on your website is editing content or previewing web pages. For example, websites with e-commerce pages will often perform stress testing by sending large numbers of hits to a specific page on their site. If you do this, you won't want these hits to show up as visits in your HubSpot or Google Analytics tools.
Fortunately, HubSpot's tracking code will not be executed on preview pages within content editors or HubSpot tools. While in-app traffic shouldn't be a cause of concern in HubSpot, it can affect the numbers being recorded by Google Analytics. To avoid this from happening, filter the IP addresses of any internal users through your Google Analytics tool.
Why May This Traffic Be Reported Differently?
Your marketing efforts have no bearing on your internal traffic. It's your external traffic that you're analyzing to determine the effectiveness of your marketing efforts or the performance of your website. The last thing you want is to have your internal traffic counted along with your external traffic as this can make your results look better than they are.