10min read

3 Genius Ways to Track Your Marketing Success: HubSpot Link Tracking

by Article by Dan Moyle Dan Moyle | November 1, 2019 at 8:30 AM

You can’t improve what you don’t measure. 

All day long you’re creating content, making call-to-action buttons, social posts, videos and more. And while it goes out into the world and you know people are getting to know your brand, you’re just not sure if you’re truly making waves. 

If you’re tracking your marketing, you know. 

But with so much to track and measure, how can you really track your marketing success? 

One measurement of marketing success you can begin to follow right now to set yourself up for success next year is tracking links. 

There are a few ways with HubSpot you can track links, like calls-to-action (CTAs), trackable URLs and event tracking.

When you’re using HubSpot, all of this takes place on your website because of the default HubSpot code.

Track Your Marketing Success with HubSpot CTAs

Let’s look first at creating CTAs to track your marketing success. You actually have three options here with the HubSpot CTA tool. 

  1. Create a button style CTA
  2. Create a text CTA
  3. Create an image CTA

Create a HubSpot CTA

Whichever style you choose, here’s a quick rundown of how to make a CTA in HubSpot.

In your HubSpot account, navigate to Marketing ➡️ Lead Capture ➡️ CTAs.


Click Create CTA. Then in the slide-in pane, select Custom Button and customize the CTA styling:

Button content: Enter the text that will display on your CTA button. Did you know you can also add emojis here? 😲🤔🤯

Button style: Use the drop down menu to select a style for your CTA button. This is where you can decide if you want your button to look like a regular text link. Just choose “Link (No Style)” from the drop down menu.

Button color: If you go with one of the buttons, click the color picker or enter a custom color hex value in the Button color field.

Advanced options: Want to go deep? Click Advanced options to customize your CTA's pixel padding and CSS styling. 

If you want to make your CTA an image, you’ll be able to choose Image Button and upload the image you’ve made. Be sure to enter alt text! 

When you're done editing your custom button or image button, click Next, then configure your CTA options:


Choose an internal name for your CTA for organizational purposes. Only you and the users in your account will be able to see this. 

Time to choose where your button will send people with URL Redirect type:

Select External website URL to link your CTA to an external page outside of HubSpot, then enter the website URL in the Enter URL field.

Select HubSpot page or blog post to link your CTA to one of your HubSpot pages or blog posts, then select the page or post in the Choose a HubSpot page or blog post drop down menu.

SPECIAL NOTE: When selecting a HubSpot page or blog post, the CTA's link is tied to the page directly (i.e., the page's ID, not the URL). If the page's URL changes, the CTA's link will automatically update to the page's new URL.

Select Meeting link to link your CTA to a HubSpot meeting link, then select the meeting link in the Choose a meeting link drop down that appears below.

Select File link to link your CTA to a file in your file manager. Click Browse files and choose a file, then select the Open page in new window checkbox if you want visitors who click on the CTA to view the image in a new browser window. 

Finally, link a HubSpot campaign if you want to associate your CTA analytics with a campaign. Simply click the drop down menu and select a campaign. 

Click Save and your CTA is ready for use in blog articles, on your website and in emails. And HubSpot will automatically track your efforts!

Track Your Marketing Success with Trackable URLs

You can also create trackable links for normal hyperlink text or buttons with the HubSpot Trackable URL builder. 

Put these URLs to use in email marketing assets, ads, PPC campaigns, guest posts and more. 

You can then tie the data into your sources report and campaign report, showing you how your efforts are paying off. 

Create a Tracking URL in Your HubSpot Portal

In your HubSpot account, head over to Reports ➡️ Analytics Tools and click Tracking URL Builder.


In the upper right, click Create tracking URL. Then in the right panel, set up your tracking URL.

Enter a valid URL for your page, and select the appropriate protocol (http:// or https://). This can be the URL of any page with the HubSpot tracking code on it. 

Click the UTM campaign dropdown menu and select the HubSpot campaign you want visits to this tracking URL to be bucketed under in your analytics tools.

SPECIAL NOTE: A campaign name is required when creating tracking a URL because the campaign name is used in several reports in HubSpot. Visits to the tracking URL will be attributed to this campaign in the sources report and will count towards the analytics for the campaign in the campaigns tool. 

Click the Source dropdown menu and select the source for your tracking URL. You can also select Other campaigns and enter a Custom UTM Source.

The UTM Medium field is optional. Enter the name of your banner ad, social post, email, etc. 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.

The UTM term field is optional. It can be used in systems like AdWords and Google Analytics to track the keywords in a pay-per-click ad.

The UTM content field is optional. Enter a name for an ad if you have multiple on your page and want to differentiate between them.  

Click Create. If you want to create another tracking URL immediately after, click Create and add another.

Add a Tracking URL to Your Content

Now that you have your tracking URL built, it’s time to use it! In your HubSpot account, go to Reports ➡️ Analytics Tools. Click Tracking URL Builder.

Hover over your tracking URL, click the Actions dropdown menu, and select Copy tracking URL. You can also copy the shortened link by clicking Copy short URL! 

Track Your Measure Marketing Success with Event Tracking

Last but not least, if you are on Enterprise, you can also do event tracking.

With HubSpot, custom events allow you to track more advanced activity. You may need to work with a developer for some of this work.

Why use custom events? Here are a few reasons.

Tracking Logins to External Site

If you have a login-only section of your external website, you can use custom events to send to HubSpot information which users are actively logging in. When users login, you can trigger the custom event. Once saved to the contact's record, you'll be able to segment and create lists based on recent logins. You might look at specific time frames and the total number of times the event has been completed. It’s a great way to go deep with a site outside of your HubSpot-hosted website.

Browser and Mobile Usage

You may want to use custom events to determine which browsers your visitors frequently use and how often they visit from a mobile device.

Abandoned Shopping Cart

eCommerce? No problem! You know that visitors often don’t complete their online purchase on an eCommerce site. Combat this by setting up a custom event trigger once the visitor has calculated shipping, then segment these contacts in a list. Use the list to send a reminder to the contacts to finish their purchase.

Create Your Custom Event Tracking in HubSpot

In your HubSpot account, find Reports ➡️ Analytics Tools, then select Events.


In the upper right, click Manage events. Then you will click Create Event in the upper right.

Now, in the right panel, set up your event:

  • Enter your Event name.
  • Manage your data! To easily find and keep track of your event, click the Tags drop down menu and select a tag.
  • Select Custom event as the Event type.

Click Next.

You can set up your custom events in two ways:

  • Using the Javascript Events API in your code
  • Via the Events HTTP API

JavaScript Events

If you're using custom JavaScript to trigger your event, enter the code into the Custom JavaScript field. Any code you enter in this field will automatically be included as part of your HubSpot tracking code. Learn more about using the JavaScript Events API.

After adding your JavaScript, click Save at the bottom right to create your event. You'll be redirected to the events dashboard. Hover over the event and click the More drop down menu, then select Edit. At the bottom right, click Next. You'll see the ID that has been generated for the event. Copy and paste the code snippet in the JavaScript callback where you want that event to trigger.

By default, the value will be set to null. This is an optional argument that can be used to track the revenue of an event. This value will be used to increment the hs_analytics_revenue property if the event is associated with a contact record. 

Each time the event runs, the value associated with the triggered event will be added to the Revenue field on the contact's record. When setting up the conversion value, you can either enter a specific value or, to dynamically set the value, enter a JavaScript variable or a full jQuery selector. If you're adding a value, ensure you add it to the value parameter before adding the code snippet to your JavaScript file.



If you're using the Events HTTP API, you don't need to enter any JavaScript in the Custom Javascript field.

First, click Save at the bottom right to create your event. You'll be redirected to the events dashboard. Hover over the event and click the More drop down menu, then select Edit. At the bottom right, click Next. You'll see the ID that has been generated for the event. You can now use this ID to trigger your custom HubSpot event using an HTTP GET call. 

When creating an HTTP API event, a URL is automatically generated, containing the following required parameters:

  • _n - the Event_ID of the event you're recording
  • _a - your HubSpot ID

In order to successfully connect a triggered HTTP API Event to a contact record in HubSpot, you need to pass the contact’s email address, &email, in the request URL. If a contact record does not yet exist for this email address, a new record will be created. Otherwise, the event will be attributed to the existing contact.

Track Your Efforts to Better Measure Your Marketing Success

If you’re not tracking who goes where, what they tap on and what’s driving their decisions, you’re not able to make informed marketing decisions. 

There’s an old saying: “Half of my marketing budget is a waste. I just don’t know which half.” Don’t let this be you. Use your HubSpot tool to its fullest with any or all of these ways to track your marketing success. 

Tracking growth with Groot photo by James Pond on Unsplash