ahmetozer şöyle diyeyim
google analytics localhosttayken aktif olmasın

$host = $_SERVER['HTTP_HOST'];
if($host != 'localhost') {?>
<script></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-1408..');
</script>

şimdi .js içine nasıl kontrolcü koyayım