Installing the HubSpot tracking code on your website allows HubSpot to monitor your website. This code is always different for each account. This tracking code is automatically included on your HubSpot blog posts, landing pages, and website pages.
If you have any externally hosted pages, meaning the pages are not on HubSpot, then you need to install the HubSpot tracking code manually to monitor and analyze those pages.
Copy your HubSpot tracking code
- Click the settings icon from the main navigation bar of your HubSpot account.
- Go to Reports>Tracking code
- In Reports and Analytics Tracking, click the tab Tracking Code.
Under Tracking code installation: Copy and paste the tracking code from Embed code section into every page of your site, just before the </body> tag.
To mail the code to your web developer, click Email to my web developer and send the tracking code to the developer who will be installing it on your site.
Install the tracking code on your website
To install the tracking code, paste the code before the closing </body> tag in the HTML code for each page of your site.
At the same time, most content management systems and your developers can install code to all pages on your site, such as a footer file that is referenced across all pages. Check with your developers on how they can help do this.
Install the tracking code on a WordPress website
It is advised to install and use the HubSpot All-in-One Marketing - Forms, Pop-ups, Live Chat WordPress plugin. The plugin automatically installs the HubSpot tracking code on your WordPress website for you.
If the HubSpot WordPress plugin doesn't get install automatically, then you can manually install the tracking code:
- Copy the HubSpot tracking code in your HubSpot account.
- Log in to your WordPress account.
- Go to Appearance > Editor in the left sidebar menu.
- In the list of theme files on the right side of the editor, select your Footer.
- Paste in the tracking code and select Update File.