Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-06-14 01:48:31

andy.photos.bell
Member
Registered: 2014-04-14
Posts: 18

Facebook pixel & Backlight cart

Facebook pixel has tracking options for such things as items being added to the cart. etc.

They provide functions to use to enable such tracking but I'm not sure where to add these - is there an easy way to do it or would it mean updating the code (wwhich I don't mind doing, but it would be a pain when Backlight is upgraded).

I've got the basic php plugins code working for Pixel...

Andy

Offline

#2 2018-06-17 22:49:59

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 14,949
Website

Re: Facebook pixel & Backlight cart

Just looked this up on Facebook and the instructions say to insert it just before the closing </head> tag.
You would use the ttg_head hook for this ( going off memory here, be sure to check in the phplugins file)

The problem you’ll run into is that there are a lot of single quotes in their script so using the normal way of just using an echo statement (echo’), you'll need to escape all those single quotes by preceding them with a backslash:  \’

There’s another way of doing it that eliminates that need and I believe there us an example of this in the Pangolin-phplugins-sample.php file ( found in your Backlight download at Backlight/custom/phplugins/)

edit: it's the example that begins with:

echo <<<SCRIPT
	<script>

Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

Board footer

Powered by FluxBB