Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

You may want to hide your Google analytics tracking code from your IP address. Why? So you can get more accurate data from the analytics program. If you track your own visits that is not giving you the full picture of your visits. Here is how you do it.

Step #1 Hide Your Analytics Tracking Code From Your IP Address

Go to Google search and type in "What is my IP". You will see that Google shows you your IP address. what-is-my-ip

Step #2 For Hiding Analytics Code From Yourself

Now you know your IP address. Open up a text editor and paste the following code into it. You have to do 2 things to this code.
  1. Replace your.ip.address with your actual IP address. Make sure that you leave the single ' on both sides of the ip address.
  2. Paste your analytics code over top where it says PASTE YOUR ANALYTICS CODE HERE. Again make sure you leave the single quote ' on both sides of the code.
<?php
add_action('wp_head', 'dont_track_my_ip');
function dont_track_my_ip() {
$myip=$_SERVER['REMOTE_ADDR'];
if($myip!='your.ip.address'){
echo 'Paste your Google Analytics code here';
}else{
echo '';
}
}
?>

Step #3 To Hide Your Google Analytics Code

Navigate to your themes functions file. Hopefully this is a child theme. Paste the code at the bottom of your functions file before the php closing tag if you have one, "?>". Save the file.

Step #4 Check your Browser

Load up your google analytics in one tab and in another tab load your website. In Google analytics go to real time and see if you can see your location. You should not see yourself.

Alternative Method For Hiding From Google Analytics

If you do not have a wordpress website and you want to hide your visits from  your website then use this code.
<?php
$myip=$_SERVER['REMOTE_ADDR'];
if($myip!='your.ip.address'){
echo 'Paste your Google Analytics code here';
}else{
echo '';
}
?>
You could paste the above code into your header.php in your theme.