Add code to the head or footer HTML of your pages
Last updated: October 13, 2020
You may want to add snippets of code to the header HTML or footer HTML of your website for custom styling or tracking purposes. HubSpot allows you to add code snippets to a specific page or blog post. You can also update your account settings to add code snippets to all pages and blog posts hosted on a specific domain.
Please note: if you're embedding code from an external source, review the embed instructions to determine where the code should be added to your page header, footer, or in the body of your page. Learn how to add your Google Analytics code in your account settings.
Add code snippets to a specific page or blog post
- In your HubSpot account, navigate to your blog, landing pages, or website pages.
- Hover over the page and click Edit.
- In the page editor, click the Settings tab.
- Click Advanced Options to access the Advanced Code Snippets section and enter your code into the Head HTML or Footer HTML field.
Please note: you'll only have access to the Head HTML field for individual blog posts.
- Click Update to publish your changes.
Add code to the head or footer HTML of all pages and blogs hosted on a specific domain
Please note: if you add code to the head or footer HTML of a specific domain, code added to Default settings for all domains will not apply to the specific domain.
- In your HubSpot account, click the settings icon settings in the main navigation bar.
- In the left sidebar menu, navigate to Website > Pages.
- In the upper left, click the Choose a domain to edit its settings dropdown menu to select the domain you want to update settings for.
- Add your code snippets to the header or footer HTML of all pages and blog posts hosted on the selected domains.
- Site header HTML
- Site footer HTML
- Click Save to apply your changes.
Related content
-
Require member registration to access private content
Users with publish permissions can control which contacts can access specific HubSpot-hosted pages, blogs and...
Knowledge Base -
Add videos to your HubSpot content
You can add HubSpot Video to rich text modules in your pages, blog posts, and knowledge base articles....
Knowledge Base -
Personalize your content
With personalization tokens, you can show personalized content to your contacts based on their property...
Knowledge Base