You2Media,
Thanks for the question. This plugin doesn’t currently support inserting conversion pixel code on specific category archive pages (like the full menu link you sent). I’ll consider adding that feature the next time I have a chance to release an update. If you want a quick and easy solution in the meantime, you can follow the 4 steps below. They assume that the brewingz.com/menu-category/full-menu/ page you sent me is a category archive page with a slug of “full-menu”, which it appears to be.
1. Paste the code below into a text editor (Notepad on Windows, TextEdit on Mac, etc.) and replace the “PASTE CONVERSION PIXEL CODE HERE” text with the conversion pixel code you want to use.
2. Save the text file as “facebook-conversion-pixel-on-full-menu-page.php” and upload it to the wp-content/plugins folder on your website, where all the plugins live.
3. From the Dashboard, go to Plugins > Installed plugins and activate the plugin.
4. Let the good times roll! And, please give my plugin a 5 star review if you found this helpful 🙂 Thanks!
<?php
/*
Plugin Name: Add Facebook Conversion Pixel to Full Menu Category Archive Page
Description: Add Facebook Conversion Pixel to Full Menu Category Archive Page
Version: 1.0
Author: Kellen Mace
Author URI: http://kellenmace.com/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
function fb_pxl_insert_code_on_full_menu_category_arhchive() {
if ( is_archive() && is_category( ‘full-menu’ ) ) {
$fb_pxl_code = “
PASTE CONVERSION PIXEL CODE HERE
“;
echo $fb_pxl_code;
}
}
add_action( ‘wp_head’, ‘fb_pxl_insert_code_on_full_menu_category_arhchive’ );
?>
Hi Kellen,
I followed your directions but when I went to activate it, I received the following error: Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected ‘http’ (T_STRING) in /home/you2preview/public_html/brewingz.com/wp-content/plugins/facebook-conversion-pixel-on-full-menu-page.php on line 16
Thoughts?
Line 16 is where you need to paste in your code. Can you please delete the whole “PASTE CONVERSION PIXEL CODE HERE” text and replace it with the entire block of conversion pixel code? You need to paste in everything within the yellow box in this image. Please let me know if that works out. I just tried it on my website and it appears to be working. Thanks!
I did and I still got the error. I am using the plugin for tracking pixels for display ads that lead to our website so the code might be a tad different from Facebook pixels.
Ok – sorry it’s not working out. It doesn’t look like any conversion pixel code is being loaded on the menu-category/full-menu/ page at all right now. I would recommend installing the Facebook Pixel Helper extension for Google Chrome. Then you’ll be able to click on it and see which pixel code is loaded on that page. It will detect tracking pixels for display ads that lead to your site.
Can you try inserting the pixel using the custom plugin again, then see if Facebook Pixel Helper detects it from the front end of your site? For it to work, you’ll need to insert the entire block of code within the yellow box in this image, as mentioned above. Your code should look similar to that, with both the start and end <script> and <noscript> tags, and everything in between them.