Exclude your own visits in Google Analytics for WordPress blogs
ADVERTISEMENTSDuring the early days of your website, you will find that most of the traffic you see on for your site is from your own visits. To prevent this, you can try excluding your own visits in Analytics.
You could do this by IP or maybe even cookies. The best method I find for WordPress blogs is to use this code :
your Google Analytics code here
This code will prevent adding analytics code to a page when it’s requested by a logged on user. I am currently using this code on my blogs and it’s working well.
You can watch the above video in better quality from .
Thanks to thinlight.org for the code.
Search JohnTP.com or view a random post
Related Articles
Find out what I am doing currently by .
Posted on August 8th, 2008 | Category: Google |
Blog for Beginners
August 8, 2008 at 8:04 pm
Thanks for the code, John. I read it somewhere that you can actually force the Analytic to show the most recent stats but I couldn’t remember which site. Do you have any idea, John?
Yan
Rajesh
August 8, 2008 at 9:30 pm
Even better is to exclude based on your ipaddress.that way, nonoe of your visits will be counted…
Code:
php if (
$_SERVER['REMOTE_ADDR'] — ) { ?> your Google Analytics code here
Rajesh
August 8, 2008 at 9:31 pm
oops the code is somethink like this:
Even better is to exclude based on your ipaddress.that way, nonoe of your visits will be counted…
Code:
your Google Analytics code here
chris
August 8, 2008 at 9:34 pm
hi, yes, its true also me often check that many visits was myself. good that you tell how to remove that.
And at the same time, I wish to like to shortcut to my page: http://www.christian-albert-mueller.com I try since long time to establish a cool blog, but it looks i am more a coder than a write. so if you wish any help of mine in small project, feel free to contact me. I am really looking for some income in this days.
JohnTP
August 9, 2008 at 12:02 am
Blog for Beginners - I did not understand what you really meant
Rajesh - Thanks for the code
Ramesh | The Geek Stuff
August 9, 2008 at 4:45 am
John,
Thanks for sharing the code. I don’t use Google Analytics yet. I’m little focused on my content recently and need to get my acts together on tracking the stats better.
~ Ramesh
Young
August 9, 2008 at 7:56 am
excuse me, but where the code should be put?
JohnTP
August 9, 2008 at 10:46 am
Young - on your themes footer.php, I had explained it in the video.
One more thing, I saw a post you put on your blog about this site with my pic but could not read it as it was in another language. What is it?
SATISH
August 9, 2008 at 5:55 pm
, just visit http://72.14.235.104/translate.....s1CxZ670bQ
To read “Young’s” blog in English.
Also read http://technotip.org/add-langu.....r-website/
And thanks for the video…really saves lot of my time!
JohnTP
August 9, 2008 at 10:20 pm
SATISH - Thanks for the translation and glad you liked the video
Young
August 10, 2008 at 1:15 am
, thanks for the answers. I haven’t seen the vidio, since the speed is too slow here to see it. I recommended your blog to the world in Chinese on my blog, and I also translated some of your posts into Chinese on Essentialblog.cn. Hope you don’t mind.
Mr Sun
August 11, 2008 at 2:12 am
Um, Google Analytics already has a feature that excludes your own ip address. In the main Settings menu, there’s a link at the bottom called “Filters Manager”. Click on it and then click on “+Add Filter”. Then you can change the filter type to “Exclude all traffic from an IP Address”.
Go to:
http://whatsmyipaddress.com/
to get your own ip address.
You have to add backslashes before every dot so if your ip is this:
12.345.67.89
You’d have to type in
12\.345\.67\.89
Though I do understand if you want to speed the loading time of your website for yourself that you’d want to exclude the script entirely.