Facebook tracking purchase
Posted: Tue Dec 13, 2016 6:14 am
Hi all,
I have my fb pixel code before the </head> tag in /catalog/view/theme/default/template/common/header.tpl so it runs on all pages.
I would like to add the purchase tracking code fbq('track', 'Purchase', {value: '0.00', currency: 'USD'}); only on checkout/checkout page just under fbq('track','PageView'); just as in the attached file.
I tried adding this to the pixel but it did not work:
if (isset($this->request->get['route']) && $this->request->get['route'] == 'checkout/checkout') {
fbq('track', 'Purchase', {value: '0.00', currency: 'USD'});
}
i got the following error in the pixel helper extension:
"The Facebook pixel code on this page didn't load, so no information was sent to Facebook"
How can i add the purchase tracking line to the checkout page only?
Appreciate your help!
I have my fb pixel code before the </head> tag in /catalog/view/theme/default/template/common/header.tpl so it runs on all pages.
I would like to add the purchase tracking code fbq('track', 'Purchase', {value: '0.00', currency: 'USD'}); only on checkout/checkout page just under fbq('track','PageView'); just as in the attached file.
I tried adding this to the pixel but it did not work:
if (isset($this->request->get['route']) && $this->request->get['route'] == 'checkout/checkout') {
fbq('track', 'Purchase', {value: '0.00', currency: 'USD'});
}
i got the following error in the pixel helper extension:
"The Facebook pixel code on this page didn't load, so no information was sent to Facebook"
How can i add the purchase tracking line to the checkout page only?
Appreciate your help!