Complete Link Tracking Guide for Digital Marketers

Edwin Choi

October 2, 2020

A person on their laptop looking at a screen with a search page.
Link Tracking

Link tracking is one of the most powerful assets when it comes to digital marketing. However, many marketers that I have spoken with are not quite sure of the importance or are confused about the entire process. This thorough guide will explain the idea behind link tracking and how it works.

What is a link?

A link also known as a hyperlink is an HTML object that allows the user to go to a new location by clicking or tapping on the link. The web address itself points to another location on the internet known as the URL or Uniform Resource Locator. In most cases, links and URLs are often used to mean the same thing.

What is the URL?

http://www.aaa.com/item?utm_source=example#content

This is an example of a typical URL which is the most important part of tracking. Once you understand the URL and its format you will easily be able to manipulate and modify it for your own needs. 

http:// - is the protocol and can be either http or https (which indicates a secure connection.

www.aaa.com - is known as the website address or host. This section will include the domain name, subdomain, and the top-level domain which is the .com, .net, or other top-level domain.

/item - is the path that takes you to another page of the domain instead of to the front page. 

?utm_source=example - is the query string or the parameters which are always after a question mark. These parameters are sent to the host which then may run a program to pass the query string. Multiple parameters can be used by separating with an ampersand &. 

#content - is the last section of the URL which is always after a hashtag known as the anchor. This section takes the user to a specific section of a web page which may not be at the top but guides the user to the exact location of the information searched. 

Altering an URL and Parameters

https://www.aaa.com/about-us
?attr1=value1
&attr2=value2
&attr3=value3

In the majority of cases, the query string is the section that you will need to alter for your needs. UTM codes are often used for adding extra parameters or you may have your own parameter created to ensure the URL is unique.

We will go into UTM codes later, but at this time we need to ensure that altering the URL will work properly to meet your needs. Understanding the format will allow you to add extra parameters without doing any harm. 

The rules that need to be followed include:

  • A question mark must separate the query string and the path
  • Parameters must be created in the form of attribute=value
  • All multiple parameters are separated with an ampersand &
  • You can create your own parameter without causing any harm

To understand, we need to add the utm_source parameter with the value medium to the links.

In our first example, we have a complete domain name, now we add the question mark to add another parameter.

So, http://aaa.com with look like https://aaa.com?utm_source=medium

In the next example, the web address or URL has a parameter so we must use the ampersand to separate in order to add another parameter. 

https://about.aaa.com/?id=345 will look like https://about.aaa.com/?id=345&utm_source=medium

Be sure to test the modified URL by using copy/paste and trying it in your browser. This will ensure that you created the parameter and obtain the results you desired.

What is a click?

Let's look at the technical side of a click or in some cases when using a mobile device a tap. By looking at this side of click, we will learn how and where we can measure the click. 

  • When a person clicks on the link, the browser will send a signal that an event occurred.
  • The browser will then check if there is a piece of JavaScript code called a handler that starts or runs when the event occurs.
  • If there happens to be a handler, the code will be performed. If there is no javascript code, the browser will look at what URL to open next.
  • The browser pulls the information from the URL and will look at the information found in the section known as the header. If no data is redirecting the browser it will continue to parse the body of the action to display the content of the destination that was placed in the browser.
  • The browser will then load all the information on that specific page including any resources such as JavaScript code, images, and so on to display the webpage in the browser. Any JavaScript code will also be executed at the time of loading.

If a link is shown in an app and not a browser, the first three are eliminated. The browser will open to request the URL directly.

People sitting around with their laptop with bar graphs, screens, money, and magnifying glasses around them.
Tracking target clicks

How to Track Link Clicks

There are three core ways to track a click.

  • Click Event: Using a JavaScript code or handler to listen for the click of the specific link on the webpage.
  • Redirect: Have the link go to a host oftentimes a shorter URL that will keep count of the clicks and then send the person to their final destination.
  • Page Load: Track the times the destination website has been requested which will allow you to track incoming traffic to your website.

Basically, clicks events will tracks links that our outgoing, redirects tracks links you share from your website, and page load will show incoming traffic.

People crowded around a computer screen studying click events.
Studying click events

Click Events and Google Analytics

In order to track links on a webpage, you must have access to the source code of the website. If you do not have direct access you can use Google Tag Manager. This type of solution usually only tracks that are outgoing on your website. It cannot track any link on YouTube, Twitter, Instagram, etc...

Google Analytics does this by grabbing the click event, counts the click for the URL and then allows the browser to open the new page.

Redirects and URL Shorteners

Redirects are great if you do not have control over where the link is placed or the destination website. This is most often used when you wish to drive traffic to a client's website using social media outlets. 

Using a URL shortener is often the choice. Bitly is the most used but any URL shortener does the same thing which makes the link shorter. 

As an example, I want to share In House Marketing vs Agency on Instagram while using utm-parameters. The URL becomes very long:

https://jetfuel.agency//in-house-marketing-vs-agency/?utm_source=instragram&utm_medium=cpc&utm_campaign=stpe

By using Bitly, we get https://bit.ly/2XSncpI which is easier to use for a website link or any social media profile. 

Bitly takes a URL and then creates a unique short name for that specific link known as a bitlink. When this is clicked the person's browser will request the Bitly host that will then, in turn, count the click and look up that long URL and send the person to the website page. 

When a person clicks the link, they are redirected to Bitly, the click will be counted and then the person will be redirected to their destination. 

You can check the statistics of the clicks by adding a +-character to the URL. These stats are available publicly to anyone. The same URL will always have the same short bitlink. So, that is a problem if you want to find clicks from different sources. 

Expert tip: A URL likely redirects to another that will redirect. To see the comprehensive chain use the curl command in your terminal or command prompt like so:

curl -sI -L http://bit.ly/2IOKsLf | grep 'Location:'

Multiple Tracking Links for the Same Destination

The same URL results in the same shortened Bitly link — so what to do when we want to track the clicks from multiple sources to the same destination? If using only one Bitly link, we would not be able to tell clicks apart based on the source.

The key to understand is that the same URL will always result in the same shortened link. Hence, the way to solve this is to make our URLs unique.

In order to make the URL unique, we need to add a parameter with a unique value. Using what we learned above about modifying a URL and the parameters, we know how to create a unique URL. The parameter you create can be anything, but it must be unique. In most cases, it would be best to use a utm parameter. 

Example: We want more than one person to use their various social media accounts to bring visitors and hopefully candidates to our internship page

The URL is: https://jetfuel.agency/internship/

In order to get more than one Bitly link we just need to add the made up parameter person and give in the value using the person's name or you can use any value as long as each one is different. 

https://jetfuel.agency/internship/?person=john
https://careers.relatable.me/jobs/46522-full-stack-web-developer?person=sandy
https://careers.relatable.me/jobs/46522-full-stack-web-developer?person=jim
and so fourth.

Using these URLs, we get different Bitly links that will let us know how many clicks were received by each person that goes to the same destination.

Person on sitting at his desk area looking at his laptop with dynamic redirects for apps around him.
Dynamic redirects for apps

Dynamic Redirects

The host that you redirect to can select the destination URL based on various conditions and there is nothing you can do. The destinations can be determined by the time of day or just randomly chosen from a list of URL's. 

Dynamic redirects are most commonly used when linking to a mobile app. This is the way in which it works. 

When a user makes a request there will be a string text known as a User-Agent. This string contains information regarding the device and browser that made the request. 

If the user is using an iPhone with a Safari browser it will look similar to this:

Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1

If the user is using an Android phone, it will look similar to this:

Mozilla/5.0 (Linux; Android 9; Pixel 2 Build/PPR2.180905.005) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36

As highlighted in bold above, the differences are used to verify the operating system. If it is an iPhone then the redirect will go to the App Store, while the Android user will be redirected to the Google Play Store. If no device if found the redirect will go to a webpage. 

One of the most used free providers that support dynamic redirects for apps is: Onelink.to

Page Load and Google Analytics

If you have control over the destination website, you can use Google Analytics to track incoming clicks. You can find this under the Acquisition section, you can go farther to discover the referrals that will show you where the clicks are coming from. 

The main problem is that in most cases the referrer cannot be discovered and will be counted as direct traffic. This does not always mean that the user typed in the destination URL in the browser. It could mean that the referrer field is not present in the click or it may be empty. The referrer could be missing when a person opens an URL in an app such as when using Instagram.com. 

To fix the problem use UTM parameters.

UTM Parameters

Instead of using Google Analytics to have incoming clicks shown as direct traffic without any more information, you can override these values by using special UTM parameters to override these values.

You do not have to use all utm parameters as they are optional. It is usually best to use a convention that will help you easily analyze the incoming traffic even though when it comes to values there are no right or wrong values. 

To learn where the traffic originated is use utm_source. An example would be medium or Facebook. utm_campaign can be used to discover if the link is part of the marketing scheme. UTM_ medium can also be sued when separating different methods, such as link_in_bio or banner. 

Values do not have to be recorded in advance anyplace. If a new value is used, it will just show up in Google Analytics. 

If you need help in creating UTM parameters you can find more information by Google's URL builders

UTM parameters can be seen by everyone, therefore, do not use any values you prefer not to be seen. 

I hope this guide has been beneficial and that you have more confidence in navigating the process of link tracing. 

Tags:

Did you like this Article?

Get the latest tips and tricks from the experts delivered straight into your inbox.

Leave a Reply

Your email address will not be published. Required fields are marked *

Launch into Success

Tell us a bit about yourself and your business. We are just one message away from the perfect partnership!