Exclude Your own visits from Google analytics on your WordPress Blog

Google Analytics is the most popular web analytics software and no doubt the best out there and many blogger’s use it for tracking thier visitors but many blogger’s complain that their own visits are counted in their Google Analytic’s report and that is annoying if your blog in new because sometimes you are going to be the only one visiting your blog, I will show you three ways to exclude your own visits from Google Analytic’s Reports:


First Method: Exclude your IP by creating a filter in Google analytics


to do that open Google analytics , click on access analytics button and sign in


sshot-22



now you will get the analytic’s settings page, click on filter manager



sshot-23


now click on add filter


sshot-24


now on the page that shows up put the information required to make the filter, the information will be as follows:


Filter Name: put anything you like like My IP or Myself


Filter Type: “Exclude all traffic from an IP address”


IP Address: Put your IP Address here (find it on whatismyipaddress.com)


Apply Filter to Website Profiles: Select your Website in the left pane and click add


And now click save changes button



*remember this tip doesn’t only works with WordPress it works with every kind of site


That’s it from now on traffic from your IP wont be counted, but if you have a dynamic IP this thing wont work as your IP will change when you restart your Internet connection, or even if you have a shared IP on a big network because other users from your network aren’t going to be counted so if you are either of the two then you should try other methods


Second Method: Add a PHP code around your Google analytics tracking code (in the footer.php file of your theme) which identifies if a user is logged in and it wont load the tracking code for that user


here is the php code:


<?php if (!$user_ID) { ?>

your Google Analytics code here

<?php } ?>



you will implement this in a way that your code looks something like this:


<?php if (!$user_ID) { ?>

<script type=”text/javascript”>

var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);


document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

</script>

<script type=”text/javascript”>

var pageTracker = _gat._getTracker(”UA-XXXXXXX-X”);


pageTracker._trackPageview();

</script>

<?php } ?>


The above is an example of the new ga.js code


that’s it you are done now with the help of this code google analytics will not load for logged in users but from what I see it will not track any kind of logged in user including your blog subscriber/commenter’s which maybe bad if you have lots of subscribers/registered commenter’s


Source For this Code: JohnTP


Third Method: Using the Google Analytics For WordPress Plugin instead of manually adding the google analytics code to your footer.php file, I too am using this Plugin and it has some cool features that includes excluding the administrator from Google Analytics Stats



sshot-26


Once you install this Plugin you just have to enter your unique Google Analytics User Account string that can be found in your tracking code for google analytics like the one above. you can get more information on how to get your user account here.


to exclude your own visits just uncheck “Track The administrator too” which is the default behavior of the plugin


that’s it save settings and you are done and as I mentioned earlier this Plugin has few other options too that you can see in the above screens like tracking Adsense clicks which isn’t too accurate but still good enough to track click bombing and it does it without modifying the Google Adsense code

0 comments: