Facebook Pixel Opencart extension will allow you to integrate the Facebook Pixel in your Opencart store(s), to track the revenue gained from Facebook ad campaigns. This extension will track the default 9 events: ViewContent, AddToCart, Purchase, Search, AddToWishlist, InitiateCheckout, CompleteRegistration with given below parameters:

ViewContent: value, currency, content_name, content_type, content_ids
Search: value, currency, content_category, content_ids, search_string
AddToCart: value, currency, content_name, content_type, content_ids
AddToWishlist: value, currency, content_name, content_category, content_ids
InitiateCheckout: value, currency, content_name, content_category, content_ids, num_items
AddPaymentInfo: value, currency, content_category, content_ids
Purchase: value, currency, content_name, content_type, content_ids, num_items
Lead: value, currency, content_name, content_category
CompleteRegistration: value, currency, content_name, status

Download the extension click here

Installation
Installation of this extension is very easy. Just follow the below steps to install the same.

1. Initally you must be having vqmod installed with your opencart
You can download the latest vqmod from here

2. Next, extract the purchased zip
3. Check for folder having name “upload”
4. Inside the folder you will find the various opencart version 1.5.X.X to 2.3.X.X
5. Once you open the version folder you will find the vqmod folder and inside that XML folder
6. Upload the XML folder into your XML folder in vqmod
7. Now go to setting and you will find the new tab has been created with the name “Facebook Pixel Code(s)”

If Event below NOT working ( Opencart 1.5.X.X )

AddToCart:
Find the line:
$(‘#cart-total’).html(json[‘total’]);

After this add this:
if(json[‘product_id’]) { fbq([‘track’, ‘AddToCart’, { ‘value’ : ” + json[‘pixel_value’] + ”, ‘currency’: ” + json[‘pixel_currency’] + ”, content_ids: [” + json[‘product_id’] + ”], content_type: ‘product’, content_name: ”+ json[‘product_name’] +” , product_catalog_id:” + json[‘product_catalog_id’] + ”}]); }

********************************************************

AddToWishlist:
Find the line:
$(‘#cart-total’).html(json[‘total’]);

After this add this:
if(json[‘product_id’]) { fbq([‘track’, ‘AddToCart’, { ‘value’ : ” + json[‘pixel_value’] + ”, ‘currency’: ” + json[‘pixel_currency’] + ”, content_ids: [” + json[‘product_id’] + ”], content_type: ‘product’, content_name: ”+ json[‘product_name’] +” , product_catalog_id:” + json[‘product_catalog_id’] + ”}]); }

############################################################

If Event below NOT working ( Opencart 2.X.X.X )

Find the line:
$(‘#cart-total’).html(json[‘total’]);

After this add this:
if(json[‘product_id’]) { fbq([‘track’, ‘AddToCart’, { ‘value’ : ” + json[‘pixel_value’] + ”, ‘currency’: ” + json[‘pixel_currency’] + ”, content_ids: [” + json[‘product_id’] + ”], content_type: ‘product’, content_name: ”+ json[‘product_name’] +” , product_catalog_id:” + json[‘product_catalog_id’] + ”}]); }

********************************************************

AddToWishlist:
Find the line:
$(‘#cart-total’).html(json[‘total’]);

After this add this:
if(json[‘product_id’]) { fbq([‘track’, ‘AddToCart’, { ‘value’ : ” + json[‘pixel_value’] + ”, ‘currency’: ” + json[‘pixel_currency’] + ”, content_ids: [” + json[‘product_id’] + ”], content_type: ‘product’, content_name: ”+ json[‘product_name’] +” , product_catalog_id:” + json[‘product_catalog_id’] + ”}]); }

Configuration
It is really simple to configure facebook pixel code extension with your store(s) after installation:

1. First you need to get the facebook pixel code from facebook ads manager account
Click the link and visit to facebook ads manager account here

2. Go to your Facebook Pixel tab in Ads Manager. >> Click Create a Pixel. >> Enter a name for your pixel. There’s only one pixel per ad account, so choose a name that represents your business. >> Make sure you’ve checked the box to accept the terms. >> Click Create Pixel.

3. Copy the code and paste the code inside the input

4. Check below small video tutorial