First, make sure you have Google Analytics installed and running on your blog.
Next, from each Web browser you use, pull up your blog. Once the page has fully loaded, enter the following javascript in the browser's location bar and press return/enter:
javascript:pageTracker._setVar('notrack');alert('cookie set');That will set a "notrack" cookie on your browser.
Finally, sign into your Google Analytics account and create a custom filter to exclude all visitors that have the "notrack" cookie set. The filter values should be:
Google Analytics should now begin ignoring your visits.
Filter Type: Custom filter > Exclude
Filter Field: User Defined
Filter Pattern: notrack
Case Sensitive: No
This approach isn't specific to Blogger; it should work on any site, including other blogging platforms such as Wordpress and Movable Type.
Also, to make it simpler to set the cookie, you may want to create a bookmark with the above javascript. Once added, simply go to your blog and select the bookmark.
Keywords: blogger ignore visits, blogger exclude, blogger hide
16 comments:
If this works, you should send it to Google together with a bill.
Why can't they just DO IT - HUH? I mean, Statcounter just DOES IT. Like "click here" and the cookie is set - how difficult is that!
Anyway, I appreciate your suggestion - it's by far the best I've seen for the Google/Blog problem - I'll try it immediately. Thanks ...
Great trick! I couldn't find a way of doing this the way they say it should be done (although it used to work with the old version of the API). Now the cookie is set and I will try and see if it works.
Thanks!
Thank you for this ! I hope it works. :))
Just tried this out, thanks for this simple trick!
I have tried everything. For hours. The suggestions from google, suggestions from other blogs about publishing html with tons of code. NONE OF IT WORKED. This worked in two seconds, thank you thank you thank you
OK, if this works it's great!
One question though. Do I have to make the steps with exactly the order mentioned? What if I first create the filter and then add the cookie to the browser?
And one more question: does the cookie expire? Should I repeat the procedure after a period of time? Of course, I guess that after a format I should do it again anyway, right?
@GsariG: Yes, you can create the filter before setting the cookie. The only place where order matters is to make sure the Google Analytics tracking code is installed on the blog before trying to set the cookie.
It looks like the notrack cookie expires after one year. If you clear your cookies periodically (or have security software that does), you'll also need to re-set it.
@mla: thanks for the quick reply! I only use it for a day so far, but it seems to work.
This trick is exactly what I needed - you don't mess with the template and it's easy to apply.
Thanks alot! :)
This is exactly what I need. Thank you. :)
I'm trying this on my web site. I am hoping that entering the java code on the home page will cover the whole site. I'm with John, why can't all the brain power at google come up with a simple button like StatCounter has.
Thanks for this!!!
@lostnbr: Yes, it will cover the whole site.
Hey, that's an excellent solution, and it's the main reason I hardly use Analytics anymore.
One question, does the cookie have to be named "notrack" or can the filter be set to ignore a different unique text string?
I mean if every domainer sets the same cookie we might lose some actual traffic stats we want to count also.
Thanks again for the great article!!
@ClearSkyDomains:
Glad you found it helpful! :)
Yes, you can change the "notrack" name to anything you like. Just make sure the name is consistent between the cookie name and the filter value.
You shouldn't need to worry about losing stats. The cookie is set only on the domain you're currently viewing. So if you set the "notrack" cookie on your site, it won't be sent to other blogs/sites you visit.
The only situation where you'd lose stats is if your visitors set the notrack cookie /on your site/, which would be an odd thing for them to do unless they're actively trying to hide from you.
Thanks so much for posting this. It's very helpful.
Have you figured out a way to do this with the newer asynchronous code? I haven't found a setVar equivalent for it yet.
Go to your website, let it load completely. Then paste into your browser's location bar: javascript:_gaq.push(function() { pageTracker._setVar('youruniquefilterid'); }); alert('cookie set');
replacing the filter id of course.
Then create the filter in Google Analytics. That should do it.
I have been looking for this kind of post for over a day now and I am just so glad that I found this post in this blog. I wish that it will also work in my blogger.
Post a Comment