How to track Facebook Ads Order Conversion tracking in PrestaShop Store

If you want to track the conversions that happen on your PrestaShop store as a result of your Facebook ads campaign, you can create a conversion tracking pixel to put on your order confirmation page of you website. Once you have the tracking pixel you need to embed it into your conversion page which is generally your Order Confirmation Page of PrestaShop. This can be done generally in two ways based on your technical skills and resources.

Method 1: Edit your theme file

If you are comfortable editing the PrestaShop theme files you can generally edit the header.tpl file and add the Facebook ads tracking pixel code in the head tags. This might require some advanced programming effort since you need to make sure that the tracking pixel appears only on the header of the order confirmation page (your conversion page) and not on all the web pages on the website. This can become little tricky for non-programmers or one with limited programming skills. Further every time you need to change the pixel id you need to edit your theme files which could be cumbersome and time consuming.

Method 2: Add the code using a PrestaShop module

This method is pretty easy and does not require any programming skills. All you need to  do is to download & install the module and configure it from your Prestashop backoffice. The nifty little module that helps you adding Facebook conversion tracking code on your PrestaShop store is called Facebook Ads Order Conversion Tracking Code Manager and is available for purchase & download on the PrestaShop Addons Market place.

Once you have installed the module all you need to do is to activate the module from the PrestaShop backoffice >> Modules section and, then just input the tracking pixel id by clicking the configure link on the module page. See below screenshots

Step 1

Step 2

Save your settings and you are almost done. With this module you now don’t need to edit the theme files and you don’t need any programming knowledge. Also you can change the tracking pixel id anytime in future without any hassles.

After making the settings you need to make test order on your website so that Facebook can verify the conversion tracking pixel is working correctly. You can check the status of your tracking from you Facebook Ads Manager account and then clicking on the Conversions tab.

For your convenience I have added the button below to buy and download the Facebook Ads Order Conversion Tracking Code Manager module from PrestaShop. Install it and start tracking the conversions right away.

 [button font_size=”20″ color=”#008000″ text_color=”#ffffff” icon=”arrow-circle-o-down” url=”” target=”_self”]Download the module from PrestaShop[/button]

 For any support or feedback feel free to post your comment below

View how to setup this module in below video

Unable to connect to MySQL from localhost: Strange error

If you trying to access your local MySQL database from your PHP script running on your local web server (like Apache) and encounter an error like below:

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in D:\projects\Pinlocal\public\test.php on line 12

Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in D:\projects\Pinlocal\public\test.php on line 12

Chances are that your MySQL database has been blocked by a firewall. However in my case my Firewall (McAfee Firewall) was configured to allow MySQL connections. I researched on net and all seem to point to configuring Firewall to allow MySQL. After about an hour of research I was stuck on the same problem and apparently the problem was something different since MySQL was already in my firewall exception list.

Few days back my McAfee alerted me that my Apache  Server is attempting to make a connection and I instructed it to block the connection. I opened the Firewall console and found that my local Apache Web server has been blocked from making any type of connection. I unblocked my Apache executable and allowed it to make Outgoing connections and to my delight I am now able to connect to MySQL from my php script without any problems. Clearly my McAfee firewall was not allowing Apache to make a connection to MySQL and the above error message was somewhat misleading. I documented it here so may be it would help someone out there facing the same problem, as I am sure uninstalling and installing MySQL wasn’t going to solve the problem which I was thinking to do as last resort.