• Hello WordPress Support,

    I want to set pixel tracking codes to specific pages on my WordPress website. I put the base pixel code on the header.php file.

    how do I add my Facebook Pixel code with tracking code for specific pages?

    Thank You

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Noshad Ali,

    If you wish to have the pixel code page specific, either you need to opt for the plugin which meets the requirement or else you need have the conditional code.

    i.e.

    if ( is_page( 1122 )) {
    	echo 'your code goes here';
    }

    Or else you can even do that via your functions.php file i.e.

    function custom_code(){
            if ( is_page( 1122 )) {
    	?>
    	CODE HERE
    	<?php
            }
    }
    add_action('wp_footer', 'custom_code');

    Check this out and see if that helps.

    Thanks.

    Thread Starter Noshad Ali

    (@noshad19)

    Can you suggest some plugins?

    I recommend using Google Tag Manager for this. No plugin required. No custom coding required.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Facebook PIxel’ is closed to new replies.