Contents
Overview
Setting up Google Analytics to not track your visits is a bit tricky. You can filter by IP, but most of us are using dynamic IP so we need another solution. You’ll learn to setup a cookie on your browser and configure settings in google analytics to achieve this.
Instructions
Create Cookie
Read this! Important: Visit your site you track using google analytics,and paste the following line line to your browser address bar. You may need to retype javascript: at the beginning of the URL after pasting.
Don’t Forget to change the Unique Word
javascript:void(function(w){try{_gaq._getAsyncTracker()._setVar(w)}catch(e){try{__utmSetVar(w)}catch(e){pageTracker._setVar(w)}}alert(w)}('Unique Word'));void(0);
Where “Unique Word” should be a phrase known only to you..It can’t be seen by sites other than analytics.
If your unique word appears in a popup box, then the cookie has been successfully set.
You need to set this cookie in every browser you are browsing with.
To test if the cookie has been set. Go to any page on your web site that uses Google Analytics and paste the following into your address bar:
javascript:alert((/__utmv=.+?\.(.*?)(;|$)/.test(''+document.cookie))?RegExp.$1:'No unique word');void(0);
Remeber, you may need to type javascript: again after paste.
Your unique word will appear in alert. mean everything set.
Tell Google Analytics
- Go to the Google Analytics Filter Manager in your Profile: All Web Site Data (Web), and Click on New Filter.button
- Type any filter name you’d like to, select the Custom Filter option
- In the Filter Field dropdown, select User Defined (near the top of the list).
- In the Filter Pattern text box, type the unique name.
Wait several days to see changes.
Development Specialist, Artist and Activist
Personal Website
Hi,
Thanks for this. It worked great for me on my laptop but it won’t work for me on my mobile. I am running Google Chrome on Android.
Might you have any idea why not?
Thanks,
Biche