Using the WordPress functions file I was able to add the tracking code. It will then make the tracking code available to every page on your WordPress site.

You will need to add this code to your theme’s functions.php usually located at:


You will need to add this code at the bottom of your functions.php file:

add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
<!-- - Google Analytics -->
// Your Google Analytics code here
<!-- End Google Analytics -->

<?php } ?>

Leave a comment

Your email address will not be published. Required fields are marked *