Facebook Pixel – all you need to know to create + install it
Facebook Pixel 101
How to create, install and utilize the power of the pixel.
The Facebook Pixel is an absolutely pivotal integration that will seriously increase the firepower and effectiveness of your digital ad campaigns.
Installing a Facebook Pixel will allow you to retarget your own web traffic, and enable a certain amount of site tracking which is useful in accurately counting your conversions.
BUT! Besides the added benefits of tracking, the Facebook Pixel allows you to leverage the power of all that data Facebook has been collecting through the creation of what are called “lookalike audiences” where you can not just retarget your own website traffic from the last 180 days but make a separate lookalike audience of highly likely customers based on the demographics of your exact audience – which is insane.
We’re gradually introducing a new version of Events Manager. This article reflects the new version. If the new version is available to you, you can toggle between versions using the button at the top of Events Manager.
Find the header of your website, or locate the header template in your CMS or web platform.
Paste the base code at the bottom of the header section, just above the closing head tag.
Optional: Toggle on Automatic Advanced Matching and verify the customer information you want to send.
Add events using the Event Setup Tool or by manually adding code to your website.
Event Setup Tool
Click Launch Event Setup Tool to add events and parameters without additional coding.
Follow the onscreen instructions to add events to your website.
Optional: Select a business category to see recommended events.
Select an event.
Select Track Event on Page Load or Track Event on Inline Action.
Track Event on Page Load: Choose this option if the action takes the user to a specific landing page, like a confirmation page after completing a purchase.
Track Event on Inline Action: Choose this option if the action requires someone to click something, like an add to cart or purchase button.
Note: If you’d like your Facebook pixel to fire on specific button clicks, you’ll have to update the code to tie an event to an action. Learn more on Facebook for Developers, under the Track In-Page Events section.
Add event parameters, like conversion value or currency, to measure additional information about your event (recommended).
Copy this event code and paste it on the relevant page of your site. Be sure not to modify the pixel code you’ve already placed in the header of your website.
For page load events: Place the code just below the closing header section of the page. For many websites, this will be right after the opening <body> tag.
For inline action events: Add the event code between script tags next to the action you want to set up, like a button.
Repeat those steps for any other events you want to set up on your website.
Click Go to Test Events to verify your event setup in real time and troubleshoot any issues in Events Manager.
Note: You can use one pixel across your whole website, including multiple pages of your website. However, there may be a need to use two pixels on one website. For example, if two different agencies run ads for your business, they may each need to set up a separate pixel on your website. Learn more about setting up multiple pixels on Facebook for Developers.