SEO & Paid Media

HubSpot Tracking Links - How to create custom tracking URLs

12 min read


Every now and then you will need to promote a page through a channel that HubSpot or Google Analytics has difficulty recording properly. When this happens, you end up throwing traffic coming from your campaign into the dreaded “Direct Traffic bin”, which leaves you little hope of understanding the true return on investment of your marketing campaign.

Another problem is when too many things are being grouped under one channel and you want to know how much traffic has come from one of your campaigns compared to another.

Sometimes, the best and only way to solve these problems is by creating custom tracking URLs for your campaign links. It is very easy to create tracking URLs using either HubSpot’s Tracking URL builder, or the Campaign URL Builder by Google, or you can even build them yourself.

A tracking URL such as the one below, might look scary with symbols such as “?_=&” and the repetition of the word “utm” but if you look closer you will see that it is actually fairly simple - and once you understand it you will be able to build tracking URLs on the fly!

https://www.prmarketingbollox.com/blog?utm_source=b2bmarketinglab.co.uk&utm_medium=referral&utm_campaign=blog_link& utm_term=url_tracking&utm_content=u_hit_that 

However, to get to that point we need to take a step back and understand some basic aspects of tracking URLs - especially the tracking links that you can build using the above-suggested applications.

UTM Parameters

The custom URLs that can be built and read by HubSpot and Google Analytics are comprised of two main elements.

1. The page URL

In the above example this is everything that is before the “?” is your landing page URL 


i.e. the link that you would use if you had not thought about using a HubSpot tracking link.

2. The UTM parameters

Everything after the “?"  is what gives the “tracking” to your “tracking URL”

(utm_source=b2bmarketinglab.co.uk&utm_medium=referral&utm_campaign=blog_link& utm_term=url_tracking&utm_content=u_hit_that)

If you what to know more about UTM Parameters and how they came to be, Wikipedia has a great article here.

However, some parameters are more important than others, so let's focus on the five you need to know.

In the above example, we can see all of them together with their values, separated by “&”. The parameters take values that we specify and can be virtually anything.

You can see the values that I have set here as it is the text that follows each parameter after the “=”. So, in the above example, the parameters and their values are:

UTM Parameter

Set Parameter Value












The sequence that these parameters will be included in the tracking URL does not matter and the only necessary parameter is the utm_source. However, If you actually want to use the full power of this functionality then you will have to use more than that.

In the example that follows, we will create new custom tracking URLs using HubSpot’s URL builder.

Creating a HubSpot Tracking Link

Let’s assume that we have the following situation:

Target Landing page: https://www.b2bmarketinglab.co.uk/blog/how-to-choose-the-right-hubspot-website-templates

Campaign: LinkedIn SP.P. how to

(a LinkedIn Sponsored Post promoting our "How to" Campaign) 

Channel: LinkedIn Sponsored Content

(as opposed to LinkedIn Ads, LinkedIn InMail, etc.)

Target Audiences: “Buyer Persona 1” and “Buyer Persona 2”

Creatives: “Sponsored Post 1” and “Sponsored Post 2”

In order to tackle the above, I have created two campaigns in my LinkedIn Campaign Manager account, one to target each audience, and I have created two sponsored posts with the same message but different images and used both of them in both campaigns.

I want to understand which post works better and for which audience and this is what I will try to track through my Custom Tracking URLs.

Where to go in HubSpot?

In HubSpot, I navigate to “Reports” -> “Reports Home” -> “Tracking URL Builder” and I click on the Create a new tracking URL button at the top right and this is what I see:

Links 1

I insert my target page in the first textbox and then click on the dropdown for Campaign Name. This is what will go in the “utm_campaign” parameter value and HubSpot is giving me a list of all the campaigns that currently exist in my account.

I can choose one of them if I want, but I would actually prefer to keep them separate, so I start typing a new name for my campaign. To do this I click on the orange option Create item “linkedin_spp_how_to” and my campaign is created.

Linkes 2

Now I need to choose my Source which, as you probably guessed, will populate the “utm_source” parameter value. The available values here are pre-set but I can create a custom one if I click on the Other Campaigns option. I scroll down to find the Paid Social category and click on LinkedIn.

After that, I receive the message “Traffic to this URL will appear in your Sources report under Paid Social: LinkedIn”. This has now been fixed where my campaign will show in HubSpot reporting.

NB. Google Analytics does not recognize Paid Social as a Default Channel Grouping. We will tackle that later.

Now, I want to take things a step further and use the rest of the utm parameters as I need to know which ad is working for which audience. So, I click on Switch to advanced view at the bottom of the pop-up window. As I have chosen LinkedIn from Paid Social in the source, you will see that my medium is auto-populated with paid social which is what I want.

The next two utm options are Content and Term which I will populate with sponsored_post_1 and buyer_persona_1 respectively as in the screenshot below.

Links 3

Finally, I press Generate, and voila!!!

I get my custom tracking URL as in the screenshot below.

Links 4

This is now saved in my HubSpot account and I can come back to the Tracking URL builder and find both the shortened and full versions of my tracking URL.

I have now created one custom tracking URL but I have two target audiences and two ads which make up a total number of four combinations, therefore I need four custom tracking URLs.

Now I have two options. I can either:

  1. Repeat the above process to create the other three links. (This is advised if you need to use the shortened version which cannot be created manually.)

  2. Copy the URL in a spreadsheet and manually change the utm parameter values to create all the variations that I need. (This is a quicker way of producing tracking URLs, especially when you need to create a large number of them. Even though the URLs have not been built out in HubSpot's URL builder, HubSpot will recognize the parameters and bucket the traffic accordingly). 

For my LinkedIn Sponsored Posts campaign, I do not need the shortened version of the URLs and for the purposes of this demonstration, I will do this manually.

However, knowing my way around Excel helps a lot in this process!

I copy my newly created tracking URL to an Excel spreadsheet and using the Text to Columns function and the symbol & as my delimiter, I break my tracking URL into its components as shown below

Links 5

I need another 3 variations of the tracking URL in which the landing page, campaign, source, and medium will be the same. So I copy those 3 times.

Links 6

And now I need to add the variations of target audiences and ads such as below (I have colour-coded to show identical values).

Links 7

And now by using the formula =B2&"&"&C2&"&"&D2&"&"&E2&"&"&F2 I create all the tracking URLs that I need in a new column. This formula uses the content of columns B-F but separates each parameter with an & symbol. 

And now I have my four tracking URLs ready:





Prepare your Google Analytics for your custom tracking code

Google Analytics has a pre-set dimension which is called “Default Channel Grouping”. This is the channel breakdown that most of us know and love in Google Analytics. For sessions to be attributed to one of these channels, the session medium has to match some predetermined values in Google Analytics. If they do not, your traffic will be bucketed in “Other” or “Direct” which is not very helpful. Here is a list of what you could set your medium value to assign your traffic to the channel you want:

Default Channel Grouping

utm_medium value

Organic Search










Paid Search





Additionally, there are ways to build your own channels and add them to the “Default Channel Grouping” in case you think that your tagged traffic should be shown separately from other sources. A perfect example is the one that I have given above where the traffic that will be generated from the LinkedIn Sponsored Posts campaign is “Paid Social” and does not belong under “Social” or “Paid Search”. Google Analytics does not have Paid Social as a pre-set channel, so you might want to create that. Here is a link on how to do this in Google Analytics.

Here at Huble Digital, we love creating accurate and concise reports. We will be happy to help you build your own and help you with your tracking and reporting needs in HubSpot.

Book a free SEO audit

Your website is your most valuable sales and marketing tool, so it needs to be as optimised as it can be. Uncover opportunities to boost your rankings with a free SEO audit.

Latest Insights

Sales & CRM

17 min read

How to plan for a successful HubSpot Implementation

Key aspects of planning and managing HubSpot implementation. We'll guide you through every step to ensure a successful HubSpot implementation.

Read more

Sales & CRM

93 min read

The true cost of HubSpot: Exploring HubSpot's Total Cost of Ownership

This guide takes a look at the total cost of ownership (TCO) of HubSpot as well as the TCO of Marketing Hub, Sales Hub, Service Hub and Content Hub.

Read more

Sales & CRM

20 min read

HubSpot HIPAA compliance: everything you need to know

Explore HubSpot's HIPAA compliance. We cover the basics of HIPAA, challenges HubSpot faced, and HubSpot's new tools to meet compliance requirements.

Read more

Marketing & Growth

23 min read

Enhancing your marketing processes with HubSpot AI

Learn how you can integrate HubSpot’s AI assistants into your marketing processes to optimize your efforts and supercharge efficiency. 

Read more

Sales & CRM

27 min read

HubSpot user adoption: a comprehensive guide to boosting CRM adoption

Explore strategies, best practices, and tools to drive user adoption in HubSpot, ensuring a smooth transition and maximising user engagement.

Read more

Sales & CRM

15 min read

How to structure your marketing department for success

To keep ahead of the digital curve, companies are rethinking their marketing department. Learn how best to structure your marketing team.

Read more

Sales & CRM

45 min read

Your ultimate guide to HubSpot Website Design

Should you build your website in the HubSpot CMS? This comprehensive guide explores the benefits of moving your website to HubSpot.

Read more

Sales & CRM

37 min read

An Introduction to CRM and how it can transform your business

The vast majority of businesses aren’t getting the value from their CRM that they could be. Use this guide to make more effective CRM decisions.

Read more

Marketing & Growth

10 min read

Why it might be time to consolidate marketing agencies

Learn why & when to consolidate your marketing efforts with an agency specializing in strategy, creative solutions & technical expertise.

Read more

Sales & CRM

31 min read

50 simple HubSpot hacks for guaranteed company growth

As a HubSpot Elite Solutions Partner, we want to make it easier for you to get started with HubSpot: 50 HubSpot hacks that you can use right now!

Read more