wordpress snippets

Inject Facebook or Google Pixels into the Head Section in WordPress

Last modified: November 5, 2018

Add the above to the functions file and switch the “PIXEL GOES HERE” with the pixels you need to inject to the head of your WordPress site.

add_action('wp_head', 'inject_into_head');
function inject_into_head(){
?>
<!-- Facebook Pixel Code -->
PIXEL GOES HERE
<!-- End Facebook Pixel Code -->
<?php
};

 

Save 4 Later
Email these links to yourself