# Adding code for Facebook Pixel

**URL:** <https://community.hubspot.com/t/adding-code-for-facebook-pixel/503>\
**Category:** Social Tools\
**Tags:** ads, landing-pages\
**Created:** [November 30, 2016, 10:02pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503 "2016-11-30T22:02:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [November 30, 2016, 10:02pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/1 "2016-11-30T22:02:52Z")

</div>

Hi! I’m looking to add Facebook Pixel code to track some of our inbound marketing from Facebook to a HubSpot landing page with a lead form. Is there a simple way to do this through the template so that it applies to future landing pages?

Thanks!!

---

<div class="post-metadata">

**Author:** ![ChampionComms](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/championcomms/32/22433_2.png) [@ChampionComms](https://community.hubspot.com/u/ChampionComms)\
**Post date:** [December 1, 2016, 12:00pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/2 "2016-12-01T12:00:10Z")

</div>

Hi Angela,

If you’re looking to add this pixel code to all future landing pages that use a specific template, you need to head over to ‘Design Manager’.

- Open up the template that your landing page is using.

- When you’re in the template, click the button that says ‘Edit’ in between Actons and Group…

- Select ‘Edit head’ from the drop down.

- Scroll down to the section called ‘Additional HTML Head Markup for this Layout’

- Paste your code in here

- Click Save

- Click Publish changes

If you want to add a pixel to an individual landing page, head over to ‘Landing pages’ from the main navigation.

- Select your landing page and Edit

- Select the ‘Settings’ tab at the top

- Scroll down to the Page settings section

- Select ‘Edit Head HTML’

- Paste your code in

- Select save changes

- Select ‘Update’

You’re done, it should now track via Facebook.

Thanks,

Rob

**Champion Communications**

---

<div class="post-metadata">

**Author:** ![bradpaulp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bradpaulp/32/51304_2.png) [@bradpaulp](https://community.hubspot.com/u/bradpaulp)\
**Post date:** [July 12, 2022, 1:19am UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/3 "2022-07-12T01:19:37Z")

</div>

Hello, in 2022 this workflow does not exist.

There is no option to edit the HTML of a landing page.

Can you update please? I am need of adding tracking script to a thank you landing page (or at least adding the tracking on form completion)

Thank you.

I am on the Starter bundle.

---

<div class="post-metadata">

**Author:** ![DianaGomez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dianagomez/32/48035_2.png) [@DianaGomez](https://community.hubspot.com/u/DianaGomez)\
**Post date:** [July 12, 2022, 4:44pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/4 "2022-07-12T16:44:38Z")

</div>

Hi @bradpaulp hope you are doing well.

I found this [article](https://knowledge.hubspot.com/website-pages/create-and-customize-pages#:~:text=To%20make%20edits%20to%20an,the%20page%2C%20and%20click%20Edit.) in our knowledge base. Here you can see how to edit the HTML of a landing page.

Hope this helps,

Diana

---

<div class="post-metadata">

**Author:** ![minozo](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@minozo](https://community.hubspot.com/u/minozo)\
**Post date:** [October 5, 2022, 2:25pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/5 "2022-10-05T14:25:07Z")

</div>

Hi @DianaGomez

I checked the article and the message.

"advanced settings are not available for pages using starter templates. "

You don’t have any idea installing facebook pixel to hubspot landing page using starter templates?

---

<div class="post-metadata">

**Author:** ![DianaGomez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dianagomez/32/48035_2.png) [@DianaGomez](https://community.hubspot.com/u/DianaGomez)\
**Post date:** [October 5, 2022, 7:56pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/6 "2022-10-05T19:56:39Z")

</div>

Hi @minozo,

Pixels from external ad networks work similarly to the [HubSpot tracking code](https://knowledge.hubspot.com/articles/kcs_article/reports/install-the-hubspot-tracking-code). When you install a pixel or tag on your website or landing page, you’ll need to make sure that you follow any relevant government or service-specific policies as mentioned in this [article here](https://knowledge.hubspot.com/ads/install-pixels-from-external-ad-networks#before-you-get-started)🙂.

To install the Facebook pixel, you will need 👇;

- In your HubSpot account, click the **settings icon** in the main navigation bar.
- In the left sidebar menu, navigate to **Marketing** \> **Ads**.
- Click the PIXELS tab.
- Click **Add pixel**.
- In the dialog box, click the **Select a pixel** dropdown menu and select the **pixel** you want to install, then click **Add pixel**.

The pixel will now be automatically added to all your HubSpot pages or external pages where your tracking code is installed. You can find more information in this [article here](https://knowledge.hubspot.com/ads/install-pixels-from-external-ad-networks) 🙂.

Hope this helps,

Diana

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [December 9, 2016, 4:23am UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/7 "2016-12-09T04:23:03Z")

</div>

Hi [@AngelaRay](https://community.hubspot.com/t5/user/viewprofilepage/user-id/1120)

In order to add HTML code to all your HubSpot site you can simply go to

Content \> Content Settings

There is a section **Site Header HTML** to Add custom code snippets to the HTML head section across all of your pages.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![WillDekrey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willdekrey/32/82667_2.png) [@WillDekrey](https://community.hubspot.com/u/WillDekrey)\
**Post date:** [April 12, 2018, 12:37pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/8 "2018-04-12T12:37:51Z")

</div>

Hi [@AngelaRay](https://community.hubspot.com/t5/user/viewprofilepage/user-id/1120),

You can quickly & easily add a Facebook pixel to all website pages (hosted by HubSpot / with the HubSpot tracking code installed) via HubSpot’s ads tools. Head to Settings → Marketing → Ads to Connect your Facebook advertising account and then click ‘Add Pixel.’ This will create a new pixel for you if you do not have one, or it will select the first pixel in your account.

Note: Soon, you will be able to choose the specific pixel you want, across connected accounts, if our selection default is not your preferred pixel.

Cheers,

Will

Product Manager - HubSpot Ads

---

<div class="post-metadata">

**Author:** ![rich01](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rich01/32/39641_2.png) [@rich01](https://community.hubspot.com/u/rich01)\
**Post date:** [April 12, 2019, 1:31am UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/9 "2019-04-12T01:31:00Z")

</div>

Hello,

I have a question that is an extension of this thread. How do you setup a FB pixel in Hubspot so that it fires when someone clicks submit on the opt-in form?

Thanks in advance.

Rich

---

<div class="post-metadata">

**Author:** ![mholman](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mholman/32/22074_2.png) [@mholman](https://community.hubspot.com/u/mholman)\
**Post date:** [June 29, 2020, 8:39pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/10 "2020-06-29T20:39:36Z")

</div>

Hey the Hubspot knowledge resource says you can’t use event tracking if you’ve used Hubspot to install the Facebook pixel. You need to install it on every page manually.

My question is if I’m trying to track a specific event, like a successful form submission, where do I install the code? Normally I would do it on the “thank you” page, but Hubspot uses in-line response for that, not a separate landing page.

---

<div class="post-metadata">

**Author:** ![LMacNeill](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lmacneill/32/21752_2.png) [@LMacNeill](https://community.hubspot.com/u/LMacNeill)\
**Post date:** [May 7, 2021, 10:15am UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/11 "2021-05-07T10:15:39Z")

</div>

Hi there, were you able to find a solution for where to put the code for hubspot form submission tracking? I’m having the same problem - i’d like to explore targeting users who don’t click submit

Thanks

---

<div class="post-metadata">

**Author:** ![ltan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ltan/32/68653_2.png) [@ltan](https://community.hubspot.com/u/ltan)\
**Post date:** [August 10, 2021, 7:53pm UTC](https://community.hubspot.com/t/adding-code-for-facebook-pixel/503/12 "2021-08-10T19:53:50Z")

</div>

any answer about this?
