Facebook Pixel Trouble
-
Hi,
Great plugin.
I am having trouble with the Facebook pixel not firing at all.
I have tested it extensively without luck.
I’d like to hard-encode the pixel instead, as this is the only thing that has worked for my website.
The code they have on the FB Support page is there:
fbq(‘track’, ‘Purchase’, {currency: “USD”, value: 30.00});
To make it a dynamic value you flip it to this code:
fbq(‘track’, ‘Purchase’, {currency: “USD”, value: <?php echo $order->get_order_total(); ?>
});However, this doesn’t work naturally because of the page generated of your plugin.
I tried to have a look at the solution through your plugin files, but I’m not that great a programmer (all self-taught), so couldn’t find how I could do the following:
— Hard encode the facebook purchase pixel to the custom page
— Use this code: fbq(‘track’, ‘Purchase’, {currency: “USD”, value: <?php echo $order->get_order_total(); ?>
});
— Replace <?php echo $order->get_order_total(); ?> with the code to pull your Total Order value from your plugins generated page.—
I hope that makes sense?
I did try your internal solutions in Settings, but that also failed to fire for me.
I did also try and do it through the HTML box on the confirmation page – that too failed.
So if you could highlight what code I need to pull from your plugin to insert the dynamic final Order Value that would work with the purchase pixel – that would be amazing!
Or if you have a better solution, I’m open to ideas :).
—
- The topic ‘Facebook Pixel Trouble’ is closed to new replies.