How to set up Sources tracking

Last updated: January 13, 2017

Available For:

Product: HubSpot Marketing
Subscription: Basic, Professional, & Enterprise

For Sources to gather the necessary information for you to make the best decisions regarding the direction your marketing will focus on, you'll need to check some settings. When you first set up your portal, these settings should be reviewed to your ensure that you are gathering all pertinent data and that it gets categorized properly.

If you are fully hosted on HubSpot, the tracking code is already embedded on all pages you create so you don't have to worry about this article's steps on installing the tracking code. However, if you are hosting your main site elsewhere and using HubSpot for just Landing Pages and/or the Blog, the analytics code should be placed within your external website's footer. Without the tracking code on your pages, visits will not be registered from those pages. This will inhibit you from seeing your total visits on the Dashboard and prevent Sources from pulling in data of where your visits are coming from.

Reports Settings

To begin, you'll want to navigate to Reports > Reports Settings.

HubSpot Help article screenshot

Tracking Code

The first thing you'll see when in Reports Settings is the Tracking Code. You'll need to embed this on any external website pages you want HubSpot to track. Once installed, it may take a few moment to write to all your pages, but you'll find instructions on how to validate that the tracking code is properly installed on your external pages. HubSpot recommends putting the tracking code toward the bottom of the page (before the closing </body> tag).Check out how to install the tracking code on a generic website.

If your external site is built on Wordpress, you can use the HubSpot WordPress plugin which writes the tracking code to your footer and allows HubSpot to segment which pages are standard pages and which are blog posts to view this data independently in your Dashboard and in Page Performance. For more information on how to set up the tracking code in WordPress check out: How to install the tracking code on a WordPress site.

HubSpot Help article screenshot


After the tracking code, you'll want to enter the domains which should be tracked as part of your site. Domains listed here in Site Domains will not count as referral traffic in your Sources reports, as they would be considered part of your site. Whether the tracking code is or is not installed on pages on those domains doesn't matter, as referrals are sourced by linking domains; referrals do not interact with the tracking code.  All domains in Domain Manager are auto-added into this area, these are listed as 'hosted' for the type.  

1. The Target Domain is the domain that is used in the Keywords, Links, Page Peformance, and Competitors apps. This is also the domain listed when you click your HubID at the top right in your portal and click to 'view your website.'

2. You then have the option for Automatic cross-domain linking that ensures that contacts who visit pages on one domain and click on a link to visit another domain (e.g. "" to "") will be counted as the same visitor and not as a new visitor.

3. After this, you can elect to Limit tracking to the domains you list in Site Domains. This ensures that if somehow your tracking code ended up elsewhere that doesn't belong to your website, it will not count visits for those domains; visits will only be counted for the domains you elect to be tracked.

HubSpot Help article screenshot

Privacy Policy

By default, this is set to not request consent for using cookies. Enabling/disabling cookies will not affect your data in Sources as HubSpot will be able to pick up where visitors came from to find your site, however this data will not be available in a contact's records (recording their original source data) if cookies are not enabled. Depending on the location of your company, you may be required by law to request consent for cookies to be used during a visitor's session, or you may not be allowed at all. Please ensure you are following the proper use guidelines specific to your location. If you're doing business in Europe, this is going to be important to get right in order to comply with EU cookie laws so please check out this article to learn how to set this up properly.

HubSpot Help article screenshot

IP Filtering

The last section in Reports Settings entails excluding traffic from the IPs you list here. It is highly recommended that you filter out your own traffic so that you don't skew your data with internal visits. Previews of your pages do not count towards traffic, but if you view a live page, this loads the tracking code which counts as a visit. If you filter your own traffic, visits aren't counted. Note that filtering IP traffic also filters submissions data from your forms.

To find your IP:

  • Go to Your IP address will display at the top of the screen. Please note that if you are working remotely, this could change frequently.
  • If you have an IT department, ask them. They'll know what it is.
  • Call your internet provider and ask them what your IP range is.
  • Find out if your internet provider can provide you with a static IP for your corporate office or home network and use that instead.
HubSpot Help article screenshot

Was this article helpful?

Previous article:

Next article: