Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-06-14 01:48:31
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...



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

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

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

Just a user with way too much time on his hands., Pangolin test site, Backlight 1.1.1 test site


Board footer

Powered by FluxBB