Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #893090
    spaulgal
    Participant

    Where do I insert a Facebook pixel?

    #893595
    Zeshan
    Member

    Hi there @spaulgal,

    Thanks for writing in!

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After that, add following code in your child theme’s functions.php file:

    // Add Facebook Custom Audience Pixel Code
    // =============================================================================
    
    function add_facebook_audience_pixel_code() { ?>
    
    <!-- Insert Facebook Pixel Code here -->
    
    <?php }
    
    add_action( 'wp_head', 'add_facebook_audience_pixel_code' );
    

    Please replace the line <!– Insert Facebook Pixel Code here –> with your Facebook Pixel code.

    Thank you!

    #894115
    spaulgal
    Participant
    This reply has been marked as private.
    #894915
    Darshana
    Moderator

    Hi there,

    You have done it correctly. You can see an example code here also (https://community.theme.co/forums/topic/facebook-pixel-3/#post-878530).

    Let us know if you need anything else.
    Thanks!

  • <script> jQuery(function($){ $("#no-reply-893090 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>