Nacho Sarmiento
Nacho Sarmiento

Reputation: 473

How to put the Facebook Conversion Tracking Pixel in OpenCart

I have the following problem:

I want to put the code of Facebook Conversion Tracking Pixel on my site OpenCart, but it is not reading sales conversions.

This code must be placed on the of my sales page. The probem is that OpenCart includes the same header on all pages of the site.

How could just insert it in the header of the sales page if the same header throughout the site?

I tried placing it in the footer but not work or bad delivery sales conversions.

I appreciate any help or idea.

Greetings.

Upvotes: 1

Views: 6516

Answers (3)

purchasetheme.com
purchasetheme.com

Reputation: 1

First of all you need to add the condition using this code $this->request->get['route'] as this will return you the path.

Next to track the sales you need to fetch the variable and put in

_fbq.push(['track','Purchase',{ 'value': 0.00, 'currency': 'USD' }]);

this will send the data to your facebook and like that you can track.

Upvotes: 0

Onur
Onur

Reputation: 21

Just put the code into : catalog>view>theme>default>common>success.tpl

Upvotes: 1

Sankar V
Sankar V

Reputation: 4128

You need to add a condition like:

 if((isset($this->request->get['route'])) && ($this->request->get['route'] == 'product/product')){
 //Your facebook code
 }

$this->request->get['route'] - this will get you the current page path.

Upvotes: 5

Related Questions