After you create and install the Facebook pixel base code on your website, you can set up standard and custom events. Learn about the differences between standard and custom events.
- If you want to set up custom events, visit the custom events section on Facebook for Developers.
- If you want to set up standard events, you can use the instructions below. Learn more about the available pixel standard events and their event code.
Note: If you want to add standard events and parameters to your website but don't want to add pixel event code, you can use the point-and-click Event Setup Tool instead.
To manually set up event codes on your website:
- Go to Events Manager.
- Select the pixel you want to set up events for.
- Click Add Event.
- Select Install events using code.
- 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 steps 6 through 9 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.
- Click Done.