<script>
console.log('Google Analytics is NOT tracking this page');
</script>
/*
Add this bit to header.php and it will only track the page if it is on your live site.
Then put the rest of the code in an "inc" directory (or wherever you want it).
The console log is a quick way to check if your live site pages are being tracked
*/
<?php
$server = $_SERVER['SERVER_NAME'];
If ( $server === "www.website.co.uk" ) :
include_once("inc/analyticstracking.php");
else :
include_once("inc/notracking.php");
endif;