Track setup

Connect your website to HubSpot by verifying your domain, install the tracking code to start collecting visitor data, configure UTM parameters to track campaign performance, and connect your advertising platforms so everything reports in one place.

Introduction

Your website is where most of your growth happens. Traffic arrives, visitors browse, some fill out forms, others leave. Without proper tracking, you have no idea who visited, what they looked at, or how they found you.

This chapter connects your website to HubSpot so you can actually see what's happening. We're installing the tracking code on every page, connecting your domain so emails don't land in spam, configuring UTM parameters so you know which campaigns work, and connecting your ad platforms so you can see ROI in one place.

I see companies skip this step all the time. They start building campaigns without tracking installed, send emails from an unverified domain that get flagged as spam, or run ads for months without connecting them to HubSpot, so they have no idea which ads actually generate customers.

Do this chapter properly, and you'll have complete visibility into your marketing funnel. Skip it, and you're flying blind.

The steps here are technical but not complicated. If you can follow instructions and copy-paste code, you can do this. If you have a developer, send them this chapter and they'll know exactly what to do.

Install tracking code on your website

he HubSpot tracking code is a small piece of JavaScript that tracks visitors on your website. Without it, HubSpot has no idea who's visiting your site or what they're looking at.

Get your tracking code

Go to Settings → Tracking & Analytics → Tracking Code.

You'll see your unique tracking code at the top of the page. It looks like this:

Install on your website

How you install the tracking code depends on your website platform:

WordPress: Use a plugin like "Insert Headers and Footers" or "HubSpot All-In-One Marketing." Paste the tracking code into the header section. The code will then appear on every page automatically.

Webflow: Go to Project Settings → Custom Code → Head Code. Paste the tracking code there. It'll automatically appear on every page.

Custom website: If your developer built your site, send them the tracking code and ask them to add it to the <head> section of every page. Most sites use a template or header file that applies to all pages, so they only need to add it once.

Shopify, Squarespace, Wix, etc.: Each platform has slightly different methods. Search "how to install HubSpot tracking code on [your platform]" or check HubSpot's knowledge base for specific instructions.

The tracking code must be in the <head> section, not the <body> section. If it's in the body, tracking won't work properly.

Verify tracking is working

After installing the tracking code, verify it's working correctly.

Go to Settings → Tracking & Analytics → Tracking Code in HubSpot. Scroll down to "Active pages with tracking code installed."

Open your website in a new browser tab and visit a few pages. Then refresh the "Active pages" section in HubSpot. You should see the URLs you just visited appear in the list.

If pages don't appear, the tracking code isn't installed correctly. Check that you copied the entire code block and that it's in the <head> section, not the <body>.

Exclude internal traffic

Once tracking is working, you need to exclude your team's visits from analytics. Otherwise, every time someone on your team checks the website, it counts as a visit and skews your reports.

In Settings → Tracking & Analytics → Tracking Code, scroll down to "Do not track."

Add IP addresses or IP ranges for your office, your home office, and anywhere your team works from regularly. You can find your current IP address by Googling "what is my IP."

You can also exclude traffic by cookie if your team logs into HubSpot. Enable "Don't track HubSpot users" and anyone logged into HubSpot won't be counted in your analytics.

This keeps your traffic reports accurate. You only want to track actual prospects and customers, not your own team refreshing pages constantly.

Connect advertising platforms

If you're running paid ads on Google, LinkedIn, Facebook, or other platforms, connect them to HubSpot so you can see which ads actually generate customers, not just clicks.

Connect Google Ads

Go to Settings → Marketing → Ads.

Click "Connect account" and choose Google Ads from the list.

You'll be redirected to Google to authorize the connection. Make sure you're logged into the Google account that manages your ads.

Once connected, HubSpot will start pulling data from your Google Ads campaigns: impressions, clicks, cost, and most importantly, which ads generated leads and customers.

This connection lets you see the full funnel: someone clicks your ad, lands on your website, fills out a form, becomes a lead, and eventually becomes a customer. Without this connection, you only see clicks and cost. With it, you see ROI.

Connect LinkedIn Ads

The process is similar for LinkedIn Ads.

Go to Settings → Marketing → Ads, click "Connect account," and choose LinkedIn Ads.

You'll be redirected to LinkedIn to authorize the connection. Make sure you're logged into the LinkedIn account that has access to your Campaign Manager.

Once connected, HubSpot will pull in campaign data and match LinkedIn ad clicks to contact records. You'll be able to see which LinkedIn campaigns generate leads and which are burning budget.

Connect Facebook and Instagram Ads

Facebook and Instagram ads are managed through the same platform (Meta Business Suite), so you connect once and get both.

Go to Settings → Marketing → Ads, click "Connect account," and choose Facebook Ads.

Authorize the connection through Facebook, and HubSpot will start pulling in campaign data, ad performance, and conversion tracking.

If you're running lead gen ads on Facebook (where people fill out forms directly in Facebook without leaving the platform), this connection automatically syncs those leads into HubSpot as contacts. No manual CSV exports required.

Review ad performance in HubSpot

Once your ad accounts are connected, go to Marketing → Ads to see all campaigns in one place.

You'll see metrics like:

  • Impressions and clicks (traffic metrics)
  • Contacts created (lead generation)
  • Deals created (pipeline generation)
  • Customers generated (revenue)
  • Cost per contact, cost per deal, cost per customer (efficiency metrics)

This is where ROI becomes clear. You might be spending £500/month on LinkedIn ads and £2,000/month on Google Ads, but if LinkedIn generates 50 contacts and 5 customers while Google generates 200 contacts and 2 customers, you know LinkedIn has better ROI even though it costs less.

Without connecting your ad platforms, you're just guessing. With them connected, you have data.

Exclude internal traffic

Conclusion

Your website is now properly connected to HubSpot. You've verified your domain so emails don't land in spam, installed tracking code so you know who visits your website, configured UTM parameters so you know which campaigns work, and connected your ad platforms so you can see ROI across all channels.

This wasn't the most exciting setup work, but it's the foundation for everything else. Every campaign you run, every email you send, every ad you publish—it all flows through this infrastructure.

In the next chapter, we'll set up your brand kit so everything you create in HubSpot looks consistent and professional. Then we'll import your existing data so your team has context on every contact.

But for now, your tracking infrastructure is solid. HubSpot knows what's happening on your website, and you'll actually be able to prove which marketing efforts drive results.

Related tools

No items found.

Related wiki articles

No items found.

Further reading

Hubspot basics

Hubspot basics

Connect your website to HubSpot by verifying your domain, install the tracking code to start collecting visitor data, configure UTM parameters to track campaign performance, and connect your advertising platforms so everything reports in one place.