How to set up sources tracking

Last updated: December 1, 2017

Available For:

Marketing: Basic, Pro, Enterprise
Sales: N/A

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.

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.

Please note: 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.

Navigate to reports settings

In your HubSpot Marketing BasicProfessional or Enterprise account, navigate to Reports > Reports Settings.

HubSpot Help article screenshot

Set your target domain

The first thing you'll see in the Tracking Code tab of your reports settings is your target website domain. The Target Domain is the domain that is used in the keywords, links, page performance, and competitors apps. This is also the domain listed above your Hub ID in the top right corner of your account.

HubSpot Help article screenshot

Install your tracking code

You'll need to embed the tracking code 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 this article about 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 here.

Set your privacy policy

By default, this is set to Do not notify visitors that your site uses cookies. Enabling/disabling cookies will not affect your data in the sources report, as HubSpot will still be able to pick up where visitors came from to find your site. However, original source 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 to track cookies at all. Please ensure you are following the proper use guidelines specific to your location. If you're doing business in Europe, check out this article to learn how to set this up.

HubSpot Help article screenshot

Navigate to advanced tracking

In the Advanced Tracking tab, you can view your other connected domains and add any external websites that have your HubSpot tracking code installed. To add an additional external domain, click Add domain.

In this section, you can enable Automatic cross-domain linking to ensure 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.

You can also select to Limit tracking to these domains in your list of 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. With this setting enabled, visits will only be counted for the domains you choose to track.

HubSpot Help article screenshot

Exclude traffic from your reports

The last section allows you to exclude traffic from specific IP addresses and referral domains. 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, your views to live pages will count in your traffic analytics unless you filter your IP addresses. Note that filtering IP traffic also filters submissions data from your forms. Learn more about how IP filtering impacts form submissions here.

You can find your current IP address at the top of this section. If you need to determine other IP addresses for your home or business, ask your IT department or internet provider. Add your IP addresses to the IP Addresses to Exclude field. Use commas to separate different IP addresses (for example,, and use dashes to represent entire ranges of IP addresses (for example: -  

You can also filter our traffic from specific domains, by adding the root domain (for example, to the From these referrers field. When you're finished, click Save

HubSpot Help article screenshot

Was this article helpful?

Previous article:

Next article: