Don’t count me Google Analytics on my domain!
This tutorial can be used on any web page , scripts including WordPress. I’t will eliminate your visit count in google analytics on a custom click in your site. This tutorial can be useful to owners, administrators, employers and developers of the sites.Seams like google changed some things in googele analytics code in a certain time so other tutorials like this or this those not work. While I was exploring the problem I notice the new things are added to google analytics API. _setVar() is now now deprecated and instead of this its better to use _setCustomVar(). This custom variables sets cookie “_utmv” on your browser so you can place custom string in it like for filter manager. This cookie last 2 years from set/update. Filter manager in analytics give you option to exclude some of visitors from your site analytics like visitor with custom seated cookie “_utmv” .
Because all of this they are two ways to set custom cookie.
In ether way first you must set filter in google analytics.
1. Case (For me this one worked and. I’m using WordPress)
I’t is very important to place this code in page where google analytics code is placed.
<a href="" onclick="javascript:_gaq.push(['_setVar', 'noGA']); alert('Custom cookie has been set.')">Click this Link</a>
Go to page where you placed your code and click on it!
2. Case (For newer google analytics code and if first case code doesn’t work. This is not tested.)
<a href="" onclick="javascript:_gaq.push(['_setCustomVar', 'noGA', 'noGA']); alert('Custom cookie has been set.')">Click this Link</a>
Go to page where you placed your code and click on it!
How to check if its working?
Navigate to your brouser cookies an check your domain for custom cookie “_utmv”.
Please comment if something stuck.
This info is the cat’s pajaams!