Using events to track conversions with the Facebook Pixel

Our direct Facebook Pixel integration allows you to track page view event tracking on your landing pages. Besides this, Facebook allows for custom events usage. The advantage of implementing custom events instead of the standard page view event is that you can use conversion optimization and track more efficiently. Furthermore, using custom events will allow for a more granular use of Facebook's Custom Audiences feature.

Custom conversions can be triggered either by Button Clicks, by Form Submissions or by visits to a thank you page (used as a conversion page).

Please check our article on how to connect your Facebook Pixel to your landing page here: https://d.pr/hQielM. You first have to connect the main Facebook Pixel integration.

After placing your Facebook Pixel ID on your page, follow the instructions below to set up your desired event tracking.

The code snippets will need to be placed in Settings - Javascript - Body.

Screenshot_on_2023-03-22_at_19-54-59.png

1. Conversions triggered by button clicks

For tracking button clicks on your page as Facebook custom events, you will need to use the following code snippet:

You will need to customize the code with your Facebook event and change the #element-ID with the corresponding element ID that you want to trigger the event. Here is how you can find the button element ID number:

editcssnew.gif

If you want to track multiple buttons you will have to add the code again for each button. Don’t forget to customize all the individual code snippets to have the correct element ID number and event name for each separate button.

2. Conversions triggered by form submissions

For tracking form submissions as Facebook custom events, please use this code snippet:

If you have multiple forms on the same page, please use the snippet below. This needs to be pasted into Settings - Javascript - Body:

For this second code snippet, you will need to edit the "wid" value, which is only the digit part of the element ID. For #element-659, the "wid" value is "659".

NOTE: The "instapageFormSubmitSuccess" function can only be present on the page once, regardless of how many forms you have or how many actions you want to trigger after form submission. In case you have multiple snippets that need to fire after form submission, you must add all of them under the same Form Submit Callback function. If the snippets are not added under the same Form Submit Callback script, only the last function in the source code will be triggered.

When using the FB Pixel Helper (browser extension) to check if the pixels are firing correctly, please disable the AdBlocker extension (if the case).

3. Conversions triggered on the thank you page

You can also track conversions with a thank you page. First, create and publish a thank you page, and then set your main landing page to redirect to the thank you page.

In this case, both pages should have the Pixel ID connected through our direct integration in the page slideout under Integrations > Marketing Tags & Pixels , according to this article: https://d.pr/GdVMtM.

After making sure that the pixel is connected on both pages, add this code snippet only to the thank you page, in Settings - JavaScript - Body:

In the code snippets above, fbq('track'  , 'Lead') is an example, but you can choose to replace it with any predefined Facebook events:

Standard Event Name

Promoted Object custom_event_type value

ViewContent

CONTENT_VIEW

Search

SEARCH

AddToCart

ADD_TO_CART

AddToWishlist

ADD_TO_WISHLIST

InitiateCheckout

INITIATED_CHECKOUT

AddPaymentInfo

ADD_PAYMENT_INFO

Purchase

PURCHASE

Lead

LEAD

CompleteRegistration

COMPLETE_REGISTRATION

 

Here's more about setting up a custom event, from Facebook: https://d.pr/rqOHYi

In case you need help with a custom functionality or any code customization that is not provided through our Help Center articles we have a Professional Services team that can help our Convert users. The Convert plan includes Professional Services as well as additional features and services that can be seen here: https://instapage.com/convert-benefits 

 

How to track the same action on multiple platforms at the same time

If you need to track conversions using events from both Facebook(https://d.pr/K56sJw) and Google Analytics(https://d.pr/hoi7AN) or Google Ads(https://d.pr/mKU0dz), you just need to add the code for that platform in the same function, instead of copying the entire code again. This is because the function only needs to be triggered once. If you use the same code with the same function twice, the second function will override the first one. You can find the content of the respective functions in the dedicated articles for conversion tracking for the other platforms linked above.

1. For form submissions

2. For button clicks