---
title: How to install HubSpot tracking code
description: The HubSpot tracking code is unique to each HubSpot account and allows HubSpot to monitor your website traffic.
---

[Skip to content](https://demo.hubspotasia.com/knowledgebase/how-to-install-hubspot-tracking-code#main-content)

[![hy\_digital\_logo](https://demo.hubspotasia.com/hs-fs/hubfs/Hy_20logo_01.png?width=40&height=40&name=Hy_20logo_01.png)](https://hy.digital/)

- [Home](https://hy.digital/)

Open main navigation

Close main navigation

- [Home](https://hy.digital/)
- [Contact us](mailto:support@hy-digital.com)

[Contact us](mailto:support@hy-digital.com)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://demo.hubspotasia.com/knowledgebase?hsLang=en)
2. [Set Up](https://demo.hubspotasia.com/knowledgebase/set-up?hsLang=en)

# How to install HubSpot tracking code

## The HubSpot tracking code is unique to each HubSpot account and allows HubSpot to monitor your website traffic.

### Getting Your Tracking Code

1. Go to HubSpot Settings (gear icon)
2. Navigate to: 
     - Marketing Starter/Free: Go to "Tracking Code"
     - Other subscriptions: Go to "Tracking & Analytics" \> "Tracking code"
3. Find "Embed code" section
4. Click "Copy" or "Email to my web developer"

### Installation by Platform

#### 1. Standard Website

- Paste code before closing `</body>` tag
- Add to all pages of your website
- Best practice: Add to footer file for site-wide implementation

#### 2. WordPress

**Recommended Method:**

- Install "HubSpot All-in-One Marketing" plugin
- Plugin automatically handles code installation

**Manual Method:**

1. Go to Appearance \> Editor
2. Select Footer file
3. Paste tracking code
4. Click "Update File"

#### 3. Shopify

1. Login to Shopify admin
2. Go to Online Store \> Themes
3. Click Actions \> Edit code
4. Open theme.liquid
5. Paste code before `</body>`
6. Save changes

#### 4. Wix

1. Go to Settings \> Advanced
2. Click Custom Code
3. Click "+ Add Custom Code"
4. Paste tracking code
5. Name it "HubSpot Tracking Code"
6. Select: 
     - All pages
     - Load code on each new page
     - Body - end
7. Click Apply

#### 5. Squarespace

1. Go to Settings
2. Navigate to Advanced \> Code Injection
3. Paste code in Header field
4. Save changes

### Important Notes

#### Do's

- Install on all pages
- Verify installation
- Add external domains to HubSpot settings
- Use only one tracking code per page

#### Don'ts

- Don't install multiple tracking codes
- Don't use on AMP sites
- Don't forget to verify installation

- [Onboarding](https://demo.hubspotasia.com/knowledgebase/onboarding?hsLang=en)
- [CRM](https://demo.hubspotasia.com/knowledgebase/crm?hsLang=en)
- [Set Up](https://demo.hubspotasia.com/knowledgebase/set-up?hsLang=en#main-content)

    - [CRM](https://demo.hubspotasia.com/knowledgebase/set-up?hsLang=en#crm)
- [Sales](https://demo.hubspotasia.com/knowledgebase/sales?hsLang=en#main-content)

    - [sales tool](https://demo.hubspotasia.com/knowledgebase/sales?hsLang=en#sales-tool)
- [Marketing](https://demo.hubspotasia.com/knowledgebase/marketing?hsLang=en#main-content)

    - [Email](https://demo.hubspotasia.com/knowledgebase/marketing?hsLang=en#email)
- [Service](https://demo.hubspotasia.com/knowledgebase/service?hsLang=en)

- [Home](https://hy.digital/)

[![hy\_digital\_logo](https://demo.hubspotasia.com/hubfs/Hy_20Digital_20.svg "hy_digital_logo")](https://hy.digital/)

## **Hy Digital | HubSpot Gold Partner Agency in Thailand**

709/23 Soi Onnut 7, Sukhumvit 77 Road, Onnut, Suanluang, Bangkok, 10250 Thailand

[mailto:hello@hy-digital.com](mailto:hello@hy-digital.com)

Copyright © 2025, Hy Digital