How to create and implement tracking URLs

Last updated: January 9, 2017

Available For:

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

HubSpot's tracking code automatically detects the referring site that a visit originates from. It uses this information to help determine which source to use to categorize that visit. In addition to the referring website, HubSpot's tracking code looks for additional information in tracking URLs.  

A tracking URL is a url that includes additional tracking information in the form of a query string (additional parameters attached to the main url following a ?). When a page is visited from an outside source using a tracking url, the parameters in that URL inform HubSpot's tracking code about the origin of that visit. This helps HubSpot determine the source of that visit, contact, or customer and allows you to break down your data based on your parameters in the Sources report.

If you plan to use HubSpot tracking URLs in Google AdWords ads, please be sure to use the Full Tracking URL, and not the Shortened Tracking URL. Due to recent changes in AdWords ads, users will now need to use Upgraded URLs. Also, it is imperative that you insert your HubSpot Full Tracking URL into the Final destination field in AdWords ads, not the Destination field. In addition to this, the Final destination field will need to contain the same domain as the landing page URL. For example, if your ad's landing page is http://offers.yoursite.com/demo your Final destination field will need to contain yoursite.com

When to use a tracking URL with HubSpot

The HubSpot Sources report can bucket most types of visits without a tracking URL, but tracking urls can be useful for categorizing PPC, Email, and Social Media traffic. HubSpot's email and social Publishing tools, automatically update shared URLs with tracking parameters, so you don't have to manually create them for those sources, unless you want to. Additionally, if you have auto-tagging turned on in Google AdWords, all PPC traffic will be categorized under Paid Search.

In addition to those sources, Tracking URLs can be used to segment visits into the Other Campaigns channel. All sources that are not set email, PPC, or social, will be bucketed as Other Campaigns. For example, if you had a QR code for a print ad that you were running, you could use a tracking URL with the parameter utm_source=print, and all traffic to from that ad's QR code would be categorized as Other Campaigns. 

To learn more about how HubSpot categorizes visits in the Sources report using tracking URLs, refer to these rules.

HubSpot Help article screenshot

Components of a tracking URL

  • Campaign Name - This utm_campaign parameter groups all traffic to that URL into one campaign in Sources. Visits to this tracking URL will be attributed to this campaign name, when you click into different channels in the Sources report.
  • Source - The utm_source parameter specifies which source or channel the traffic is originating from.
  • Medium - The utm_medium specifies the marketing medium. This parameter is not required to bucket traffic in Sources; however visits to this tracking URL will be attributed to this marketing medium, when you click into certain channels in the Sources report.
  • Content - The utm_content parameter can be used to include the name of your content in your URL for reporting purposes. This parameter does not appear in the Sources report, with the exception of the email name with the Email Marketing source.
  • Term - The utm_term parameter specifies the keyword associated with the tracking URL. Term is not used in HubSpot, but can be used to track pay-per-click ads in systems like AdWords and Google Analytics.

Instructions

Follow the instructions below to manually create a Tracking URL in HubSpot.

Navigate to the Tracking URL Builder

From the HubSpot Marketing Dashboard, navigate to Reports > Reports Home.

HubSpot Help article screenshot

Scroll down and click Tracking URL Builder in the side menu.

HubSpot Help article screenshot

Create a New Tracking URL

You'll then be able to create a tracking URL. Select Create a New Tracking URL.

HubSpot Help article screenshot

Page URL

Add the URL of the page that you would like to link to. This can be the URL of any page with HubSpot tracking code on it, but for the purposes of this article, we will use a landing page URL.

HubSpot Help article screenshot

If your page is hosted over https, you can click the gray box with "http://" to toggle the protocol of the tracking URL to https.

HubSpot Help article screenshot

Campaign Name

Next, you'll want to choose the campaign name you want visits to this tracking URL to be bucketed under in the Sources Report. You can select an existing campaign from the dropdown menu, or you can create a new campaign by typing in the name of the new campaign and clicking "Create item" option in the dropdown menu.

Keep in mind that the campaign name will be visible to your website visitors in your URL.

HubSpot Help article screenshot

Source

The next step is to choose the source that you want visits to this tracking URL to be attributed to in the Sources Report. In the dropdown menu, you can select any of the default sources buckets, like Email or Paid Search.

HubSpot Help article screenshot

Once you select the source, you will have more options to add detail to the tracking URL. Depending on which source you select, you will have different options. For example, if you select "Email Marketing", you have the option to enter the name of the email. Based on the source you select, you'll see where HubSpot will bucket traffic to your tracking URL in the Sources Report. For more information on how HubSpot categorizes visits in the Sources Report, check out this article.

HubSpot Help article screenshot

Alternatively, you can create your own custom source which would show up under Other Campaigns in the Sources Report.

HubSpot Help article screenshot

By toggling the "advanced view" at the bottom right, you can add addition parameters, like a Medium or Term

  1. Medium - This is an option field that identifies the type of marketing material you track. For sources bucketed under Other Campaigns, the medium is visible when you drill down into a specific Campaign. This is typically the last visible parameter in your tracking URLs that you build in HubSpot.
  2. Term - This is an option field that isn't used in HubSpot, but can be used in systems like AdWords and Google Analytics to track the keywords in a pay-per-click ad.
  3. Marketing Action Information - These are like post-its for your analytics. Scroll down and name your event, then select the date the campaign is launching. It will appear as a Marketing Event within the Sources Report, so you can see why there were spikes in traffic/leads on a certain day. This is completely hidden to your website visitors, so go nuts.

Once you have filled out all required fields and any desired optional fields, click Generate, and HubSpot will then generate a new tracking URL for you.

Copy and implement your Tracking URL

Copy the Tracking URL that appears, and use that as the hyperlink in your email, your Google Adwords destination URL, your banner ad, etc. You can choose from the shortened link (perfect for social media) or the full tracking link for other purposes like Google Adwords. You can also generate another URL right from this screen by selecting Generate another.

HubSpot Help article screenshot

If you don't copy the Tracking URL from the success screen above, not to worry, you can copy the link from your preferred version of the Tracking URL by clicking into the desired box in the Tracking URL Builder page.

HubSpot Help article screenshot

Previous article:

Measuring Your Performance Project

Next article: