Skip to content

Install Facebook event codes on your pages

Last updated: May 24, 2024

Ad blockers may block some of the content on this page. To prevent this, pause your ad blocker while browsing the Knowledge Base.

Available with any of the following subscriptions, except where noted:

Marketing Hub   Professional , Enterprise
Legacy Marketing Hub Basic

You can install Facebook event codes on your pages to track specific actions visitors take on your site on Facebook.

Before you get started

Before you install your Facebook event code, please note the following:

  • Facebook event codes will not work if you installed the Facebook pixel with the HubSpot Ads tool.
    • If you want to add Facebook event codes to your pages, you must install the Facebook pixel code manually by adding it to the footer HTML of your website pages.
    • However, if you install the Facebook pixel code manually, you will not be able to create Facebook website audiences from HubSpot.
  • In most instances, Facebook event codes will conflict with other codes on your page when added to the Head HTML. In order to ensure the Facebook even code fires correctly, add it to the Footer HTML.

Install your Facebook event code

To install a Facebook event code on your page: 
  • Navigate to your content:

    • Website Pages: In your HubSpot account, navigate to Content > Website Pages.
    • Landing Pages: In your HubSpot account, navigate to Content > Landing Pages.
  • Click the name of your content. 
  • In the content editor, click the Settings menu and select Advanced.
  • In the Footer HTML section, paste the Facebook event code.
  • In the upper right, click Publish or Update.
set-footer-html-for-facebook-tracking 

Necessary disclosure: HubSpot will automatically place Facebook event codes on your website pages where the HubSpot tracking code is present. These event codes send and track information about your website visitors back to Facebook, which enables conversion tracking.

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.