How do I add HubSpot tracking code to my external site?

If you are adding the tracking code to a website that is not hosted by HubSpot, you will need to make sure that the website allows JavaScript code to be executed.

To add HubSpot tracking code to your external site, you can follow these steps:

  1. Go to your HubSpot account and copy your tracking code.
  2. Log in to your external site's content management system (CMS).
  3. Paste the tracking code into the <head> section of your website's HTML code.
  4. Save your changes and preview your website to make sure the tracking code is working properly.

Here are some additional tips for adding HubSpot tracking code to your external site:

  • Make sure that you are copying the correct tracking code for the website that you are adding it to.
  • If you are adding the tracking code to a website that is not hosted by HubSpot, you will need to make sure that the website allows JavaScript code to be executed.
  • You can test the tracking code by opening a page on the website in your browser and right-clicking anywhere on the page. In the dropdown menu, select Inspect Element or Inspect. A toolbar will appear at the bottom or side of your screen.

In the toolbar, click on the Console tab. Then, type in the following code:

Code snippet
document.querySelector('script[src*="hubspot.com/js/tracking/"])
Use code with caution. Learn more

If the tracking code is installed, you will see a line of code that matches the code you typed in. The line of code will include your HubSpot account ID.

If you do not see a line of code that matches the code you typed in, then the tracking code is not installed correctly. You can try copying and pasting the code again, or you can contact HubSpot support for help.