How to block own ip in New Google Analytics?

Status
Not open for further replies.
3 comments
You mean, in localhost?

Try this:
Code:
<?php
    $whitelist = array('localhost', '127.0.0.1');
    if(!in_array($_SERVER['HTTP_HOST'], $whitelist)){
?>
Google Analytics code
<? } ?>
This works for me in Wordpress. Not tested in somewhere else.
 
Status
Not open for further replies.
Back
Top