How to add a tracking code to a HubSpot page

How to add an analytics tracking code onto a HubSpot landing page

The following knowledge base article will show how to insert a tracking code into a HubSpot landing page so that you can use external analytics tools to measure the engagement levels on your landing page.


Add a tracking code to a HubSpot page:

  1. Get your HTML tracking code snippet from your analytics tool
  2. Open HubSpot and go to “Marketing”, “Website”, “Landing Pages”.
  3. Select your landing page and click “Edit”
  4. In the top tabs of your landing page go to “Settings”
  5. Scroll down and select “Advanced Options”
  6. Paste your tracking code under “Additional code snippets”.
  7. Click “Save”.

You can add raw HTML snippets, embed codes, or tracking javascripts within the "<head>" tag, or right before the "</body>" tag on the page.

Add a tracking code to multiple HubSpot landing pages

If you would like to add a tracking code to all HubSpot pages hosted on a specific domain then:

  1. In HubSpot, go to “Settings”
  2. Click “Website”, “Pages” at the bottom on the left
  3. Under the “Templates” tab you will be able to paste your domain wide tracking code under “HTML”, “Site Header”/”Site Footer”. 

Our content includes affiliate links. This means that we may receive a commission if you make a purchase through one of the links on our website. This will be at no cost to you and helps to fund the content creation work on our website.