The Simplest Filtering Method to Exclude Traffic from Your Internal Computers in Google Analytics, No IP Address Lookup!

Don't spend time trying to analyze your Google Analytics traffic until you've followed this simple guide to excluding your own traffic from the analytics results. When your web site has relatively few visitors, your influence as the author of the web site on the traffic statistics may make them nearly meaningless.

In about one minute you can follow these easy instructions to ensure that the traffic you see in Google Analytics is an accurate representation of the visitors that you care about. You will not need to download any software or browser plugins and you can follow the instructions in the web browser of your choice.

Google Analytics traffic filtering is applied for any new traffic coming in, so your existing statistics will not be changed. If you decide to start another web site, remember this advice as a first step to keep your traffic graphs clean from the start.

Update: Our easy commands below have been updated to support the recently released Asynchronous Analytics tracking. - Jan. 27, 2010

Part 1: Give your computer a name

The first step to excluding internal traffic from your web site traffic stats is to give Google Analytics something unique by which to identify you.

  1. Go to any page on your web site that uses Google Analytics tracking. If you use HubPages, you can follow these instructions without leaving this page!
  2. Copy the entire one-line code below and paste it into your web browser address bar, entirely replacing the current web address. You may need to retype javascript: at the beginning of the URL after pasting.
  3. Replace Unique Word near the end with any word of your choice, always use the same word to avoid having to make changes in Analytics.
  4. Once you have changed the code, press the Enter key.
  5. If your unique word appears in a popup box it has been successfully set.
  6. Repeat these steps on all of your sites that use Google Analytics, once per domain (i.e. only once for all of your content at hubpages.com, and once again for yourwebsite.com). If you use multiple web browsers, these steps may need to be repeated in each.
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);

No popup?

Recent browser updates may disable the ability to run this code from the URL bar. Try these instructions instead.

Firefox: go to the Tools menu > Web Developer > Web Console. You will see a > with a blinking cursor beside it. Paste the code in the article then press the Enter key. To close the console, hit the x button at the top of the console panel.

Chrome: click the wrench icon then select Tools > Javascript Console. You will see a blue >, click in that area and paste the code above. To close the console, hit the x button at the top of the console panel.

This code tells Google to store a specific word on your computer that will identify you when you are browsing your web site. Don't worry, your unique word can't be seen by sites other than your own.

Troubleshooting

If you experience an issue with the code above or with your traffic filtering, please post a comment below and the author will be glad to help. Be sure to read other recent comments to see if your problem has already been reported and to try potential fixes.

As web browsers adapt to new security and usability standards, some of the technology required for this script may become outdated. If your issue is not solved in the comments or in the blue box to the right, please report it with as much helpful info as you can gather.

Just hit Enter or click the button that you would use to go to a web site. The page you are viewing will not change, but you will see an "OK" dialog confirming the word that you chose.
Just hit Enter or click the button that you would use to go to a web site. The page you are viewing will not change, but you will see an "OK" dialog confirming the word that you chose.

Part 2: Tell Google Analytics to filter out your traffic

The Google Analytics Filter Manager is a very powerful tool for filtering your content. The Filter Field dropdown which you will see soon lists all of the different traffic identifiers which you can use to customize your Analytics reports.

  1. Go to the Google Analytics Filter Manager (you can always find a link to this page at the bottom of your Analytics homepage)
  2. Click the + Add Filter link which is located at the right of the gray bar.
  3. Type a filter name, something like My Traffic or Author Filter.
  4. After Filter Type, select the Custom Filter option.
  5. In the Filter Field dropdown, select User Defined (near the top of the list).
  6. In the Filter Pattern text box, type the unique name that you used in Part 1.
  7. Finally, in the Available Website Profiles list, select your web site address (i.e. hubpages.com) and click Add » to move your site to the Selected Website Profiles list. Repeat this step for each web site that you track with Google Analytics.
  8. Click Save Changes at the bottom of the page.

This simple setup will allow you to exclude yourself from your Google Analytics statistics whenever you visit your web site from your home computer. If you ever switch computers, just follow the steps in Part 1 using the unique word that you've chosen to filter.

Find the Filter Manager link below your Website Profiles list on the Analytics Settings home page.
Find the Filter Manager link below your Website Profiles list on the Analytics Settings home page.
Click the Add New Profile link.
Click the Add New Profile link.
Type a name for the filter. Choose Custom filter for the Filter Type. Choose User Defined for the Filter Field. Type your unique word as the Filter Pattern. Add any sites from which you wish to exclude yourself. Click Save Changes.
Type a name for the filter. Choose Custom filter for the Filter Type. Choose User Defined for the Filter Field. Type your unique word as the Filter Pattern. Add any sites from which you wish to exclude yourself. Click Save Changes.
If you have not installed a unique Google Analytics exclusion word on the current computer, you will see this when verifying your unique word. Follow the steps in Part 1.
If you have not installed a unique Google Analytics exclusion word on the current computer, you will see this when verifying your unique word. Follow the steps in Part 1.

How to Check If Your Browser is Filtered Out

If you are not sure whether you set a unique word or do not remember what it is, try these simple steps:

  1. Go to any page on your web site that uses Google Analytics tracking.
  2. Copy the entire one-line code below and paste it into your web browser address bar.
  3. No changes are necessary, just hit Enter.
javascript:alert((/__utmv=.+?\.(.*?)(;|$)/.test(''+document.cookie))?RegExp.$1:'No unique word');void(0);

IE 9 Users

IE 9 will remove the javascript: portion of this link when you paste it into the address bar, you will have to type that portion manually.

Your current unique word will appear in a dialog window which you can then close. If you see a different word than you set up in Part 2, you should follow the directions in Part 1 to apply the correct unique word. If you still see the wrong code after following the directions in Part 1, clear your cookies and try again - a previously set unique word cookie may be overriding your new setting. Be sure to do this step in each web browser that you use since the unique word may or may not be shared between browsers.

Translations of this article

Thank you to those readers who have taken the time to translate these instructions, your work is appreciated!

If you have written or found a different translation, please post it in the comments.

Why is This the Easiest Way to Exclude Myself from Analytics?

Unless you have read other articles already and tried to exclude yourself from Google Analytics, you may not appreciate how much simpler this is.

  • You can use the same unique word on any computer without ever returning to the Google Analytics Filter Manager.
  • You do not need to modify any of the code on your existing page.
  • You do not need to look up the IP address for your home network and all other places where you want to browse your web site.
  • IP addresses, the codes that uniquely identify computers and home networks, change often and without warning; your unique word will not change.
  • It works with both the old and new Google Analytics and Urchin tracking code.


Automatically identifying multiple authors

If you have multiple authors, you can make a simple addition to the HTML code of one of your author-only pages which will automatically add your unique code whenever they sign in. By making this change you can avoid contacting your entire writing staff with the instructions above while still ensuring that they are not tracked.

  1. Add the following snippet to your HTML code, it can appear anywhere on the page.
  2. Edit the UniqueWord to something meaningful, such as "authors"
<script type="text/javascript">
setTimeout(function (){var s=function(v){
try{_gaq._getAsyncTracker()._setVar(v)}catch(e){
try{__utmSetVar(v)}catch(e){
try{pageTracker._setVar(v)}catch(e){
setTimeout(function(){s(v)},500)}}}
};s('UniqueWord')}, 500);
</script>


NOTE: In order for this code to work, the Google Analytics code snippet must also be included somewhere on the same page, before or after the above code. Some admin systems such as WordPress may not include analytics tracking on administrative pages. While it may seem counterintuitive, you may need to paste your Google Analytics code snippet into the admin page as well in order to make the above code work.

Ignoring all visits to your hidden page

Your first visit to this author-only page will still be logged in Analytics. In order to prevent that, you can create a second filter in Analytics following the instructions above but instead filtering on the field "Request URI." For this filter, if your hidden page is at www.mysite.com/path/to/hiddenpage.html you would type "path/to/hiddenpage.html" as the filter pattern. That should prevent all of your visits to the hidden page for the purpose of installing the code on a new computer from being tracked.

Reader Feedback

Are these instructions easy enough?

  • Yes, the easiest I can find
  • Yes, easy enough for me
  • They could be easier
  • No, I know an easier way
See results without voting

Multiple user class segmentation, alternative to exclusion

If you have multiple authors, you may want to track their activity as well, just segmented out from normal users. This is also very simple to do. The instructions below will create a new Website Profile for your staff which you can access from the Google Analytics homepage.

  1. Go to the Google Analytics Create a New Website Profile page (you can always find a link to this page at the bottom of your Analytics homepage)
  2. Select Add a profile for an existing domain.
  3. Choose your web site from the dropdown list and name the profile something distinguishing, such as Blog Co-authors.
  4. Follow the instructions in Part 2, but change the selection below Filter Type from Exclude to Include. This will exclude any traffic that doesn't match your unique word.

More by this Author


Reader Comments 236 comments

ajasquared 7 years ago

Great tips! Already put into action! Great hub!


A2shley profile image

A2shley 7 years ago from Ann Arbor, MI

Thank you! So helpful :)


Lily Rose profile image

Lily Rose 7 years ago from East Coast

Thank you for this - I had excluded my IP in analytics when I first started on HubPages, but never thought to add my other blogs into the filter when I created them.

Your directions were very simple to follow - thanks.

Now I just need to figure out how to USE analytics!


harrisdy profile image

harrisdy 7 years ago from New York

great tips...


fritteritter profile image

fritteritter 7 years ago from Ohio, USA Author

Glad to hear it! Thanks for the comments.


Panda 7 years ago

Forgive my techie ignorance - do I need to do this only on my home page to stop Analytics counting me when I view every page on my website?


fritteritter profile image

fritteritter 7 years ago from Ohio, USA Author

Yes, it will stop Analytics from counting your views on any page of your site. You can double-check to make sure it's working on the other pages, just see the "How to Check If Your Browser is Filtered Out" section for instructions.

If you use subdomains on your site (i.e. news.mysite.com) you should follow these instructions at the main branch of your site, mysite.com in this example, and then that identifier will be carried over to any subdomain.


piergiuppo 7 years ago

Add ;void(0); at the end of each command to make it work on firefox+ MAC OSX see: http://www.javascriptkata.com/2007/05/01/execute-j...


piergiuppo 7 years ago

Is there any way to put these commands inside an html page (on the FTP space)? This would help excluding myself from all the computers I use. Thanks in advance


fritteritter profile image

fritteritter 7 years ago from Ohio, USA Author

@piergiuppo Thank you for the information regarding the page refresh bug, I added ;void(0); to the commands.

To insert these commands in an HTML page, simply add the entire commands shown above as the href for a link.

<a href="javascript:...">Set Analytics Tracker</a>

You may also find the code in the "Automatically identifying multiple authors" section useful as you will only need to visit a certain page from each of your computers to set the cookie and need not click a link.


Epifanio Pineda 6 years ago

Thanks for sharing, it´s simple and nice tip!


john.jackson profile image

john.jackson 6 years ago from London, England

thanks that was so helpful as I am just starting out and I am very suspicious that the views recorded were just me


Esrom Art profile image

Esrom Art 6 years ago from Indonesia

I am a beginner about internet. Your article really helpful for person like me. I appreciate your writing. I have followed your instruction and done it. It work. Wonderful. Big thanks!!!


Daniel Townsend profile image

Daniel Townsend 6 years ago

When I pasted the javascript, I did not have a pop-up window appear. I am using firefox, if that affects results.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Daniel, thank you for reporting the issue, it seems that the code above does not work with the new Asynchronous Analytics tracker launched in December. I have worked on a way to make the above commands work with the new version of the tracker as well as the old synchronous ga.js and urchin.js which were already supported. Please try the updated commands.


Edweirdo profile image

Edweirdo 6 years ago from United States

Thanks for this info - it was super simple!


Inge 6 years ago

nice...googling for "analytics dont count me" and find this article. Thanks fritteritter.


Alex 6 years ago

Is it supposed to be still working? Trying to check if my browser is filtered out, I keep having a popup showing the value of __utmb instead of __utmv.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Alex, good observation, thank you for pointing that out. The code to check the currently assigned word was too greedy and was gobbling up all of the __utmv and most of the __utmb cookie.

I fixed the "How to Check If Your Browser is Filtered Out" section, please try it again. Please post back if it still doesn't show your unique word after that change.


bcbrogan 6 years ago

Thanks much fitterritter. Fantastic tip.

I presume I have to be sure not to delete this cookie if I were to clean cookies from my computer? If this is correct, how do I now identify this cookie on my computer? I found one cookie name in reference to my site in my Temporary Internet Files folder, but in reviewing the text within this cookie I don't know if this is the one I'm looking for. It's text has reference to utma at the beginning and utmv at the end with a lot of numbers and my domain url in between, but I don't know if this is it. Thanks.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

bcbrogan, if you are clearing the cookie files from your computer I think that all of your cookies for your web site will be in one file based on your domain name.

I would suggest simply not deleting that file for your web site. This particular value is stored in a cookie called __utmv in a format like "...2378623;__utmv=21376324.UniqueWord;__utmb=..." but Analytics might reset it if you delete the other cookies manually.

Clearing cookies may be easier with a tool like CCleaner which lets you choose sites for which you want to preserve your cookies. You can read my tutorial on CCleaner and a few other cookie clearing options here: http://ccleaner.morenp.com

If you ever clear your browser's cookies (without excluding your own site) you will need to run the code in Part 1 again.


bcbrogan 6 years ago

I'm afraid I don't understand where this __utmv cookie exists and the text content of the one file related to my site doesn't have the information you presented "...2378623;__utmv=21376324.UniqueWord;__utmb=..." BUT, I did get the pop-ups with my unique word displayed with IE7,FF3.5x and Safari and then the confirmation pop up when I visited a different site page, so I guess I'm OK. I'm running a test on a specific web page and will check GA tomorrow to see if my visits were in fact excluded. Thanks for the CCleaner mention.


save my system profile image

save my system 6 years ago from United Kingdom - London

Hello there,

Thanks for the information, quite helpful in terms of being able to filter the Analytics code, but i came to understand one can configure the anlytics account to monitor the hubpages, how does that work?

As i am usually aware on how to implement the code onto any webpage, not the other way round!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

save my system, fortunately HubPages makes it easy to connect your hubs with Google Analytics. Here is a good hub which explains how to do that:

http://hubpages.com/community/Google-Analytics-for...


save my system profile image

save my system 6 years ago from United Kingdom - London

thanks filter, i tried it as explained, but hubpages shows that the code is set, and google analytics shows the code as not installed.

and i am just not sure where i got it wrong.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

I don't remember much about setting up Analytics with HubPages but it might take awhile to start picking up the traffic. Good luck, I hope someone can answer your question here or on the other hub!


save my system profile image

save my system 6 years ago from United Kingdom - London

You were right, it just a degree of patience that was required in this instance, its eventually started picking up the traffic hours later. thanks


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

I'm glad to hear that, thanks for reading!


Prcanj 6 years ago

Found this post to have the simplest and clearest instructions and saved me some time, thank you.


Prcanj 6 years ago

Please excuse second post. This all works well, until i clear cookies. Not wishing to copy and paste the unique word into the browser each time, i tried to add the 'automatically ID multiple users' code into the .../wp-login.php page but after showing the page and logging in, the cookie is not there. What am i doing wrong? Would be nice set it and forget it. thanks already for any help!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Prcanj, I just tried adding the code to a Wordpress wp-login.php and it also did not work for me. The reason that it does not work is that the Google Analytics code snippet is not included on this page - my code above requires some form of GA to be active on the page.

You will need to paste the few lines from the Google Analytics script snippet on any page where you want this to work if it is not already there. I will make a note of that in the article. Also be careful about where you put it... the login page can be accessed by guests =)


Christian Marxen 6 years ago

This is simply amazing! So easy to implement, and easily the best guide for excluding yourself from Analytics to be found on the Internet... Thanks ;)


Stu 6 years ago

Hey fritterritter

This was clear and succinct, I was done in a few minutes.

I just wanted to check something tho: my wife and I share a blog, I followed the instructions above for our main shared device at home, however it is likely I will also access our blog from work and we both have mobile devices (iPhones) do I just reuse the UniqueWord on both my work station and our 'phones?

Cheers

Stu


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Stu,

It would probably be easiest to reuse the same word for all of your systems. I just attempted the javascript: command in the web browser on my Android phone and it worked as expected.


googlesandroids profile image

googlesandroids 6 years ago from USA

Just put into action!Works great for me!Thanks pal, your the man!


jhamill 6 years ago

I have followed your instructions to the letter and it does not work :( Could this be because I am using the latest asynchronous google analytics code released a week or so ago and there is some sort of conflict?


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

jhamill,

Thank you for your comment. According to the Asynchronous Analytics changelog, the last change was back in April; I don't think any features were changed when it was recently released to everyone.

However, those April changes have deprecated some of the methods that I used in the article. Next week I will take a look at how to re-implement this in light of the deprecated methods to ensure that it works in future revisions.

For now, the deprecations should not break the above code. Which browser are you using - maybe there is a conflict there? I will check it out next week.


Sanjin 6 years ago

How do you exclude your mobile device(Iphone)?

Thanks


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Sanjin, first try to copy the code in your mobile browser and paste it into the URL bar. If that doesn't work (it doesn't work in Android OS), add a link to your site with the javascript: code. When you click that link it will properly set the cookie in iPhone or Android OS.

If you want an easy way to reset your cookie you could do something like this in your page footer:

Copyright

<span ondblclick="void(function(w){try{_gaq._getAsyncTracker()._setVar(w)} catch(e){try{__utmSetVar(w)}catch(e){pageTracker._setVar(w)}} alert(w)}(prompt('Choose a unique word')));void(0);">©</span>

2010 Sanjin

<span ondblclick="alert((/__utmv=.+?\.(.*?)(;|$)/.test(''+document.cookie))?RegExp.$1:'No unique word');void(0);">.</span>

Then you could go to your site from any device - computer or mobile - and click on the © to set the cookie or on the . to check it.

Technically you don't need all the void() stuff if you add the code to a link but it's easiest to just paste it as-is. Just remove the javascript: part and attach it with an event instead of as an anchor href so that your viewers don't click it.


Dany 6 years ago

I have done this to the letter as instructed, and it doesn't work for me. The only popup is one that says "nul" and when I run the code to check for the computer name it, of course, says none entered. Do I have the same issue as jhamill in the post 9 days ago?

I'm running IE 8 on xp pro, my site is built using xsitepro2 and runs GA in the global code.

Would LOVE to get this to work as I'm spending at lot time working on my new site and, hence, skewing all the analytic data. Will check back regularly to see if you've posted new code. Thanks for sharing the work you've done so far!


Dany- tried again, it worked! 6 years ago

Something made me go back and try this again. IT'S THE POPUP BLOCKER!!! I always manage to miss that thin grey info bar at the top! This will probably solve jhamill's issue also.

After I clicked on the "temporarily allow", I went back and re-entered the code (it didn't work when I just unblocked and then hit refresh icon. And presto! There it was!

You might also want to go into Tools>Popup Blocker>Turn Off before starting this process, but fair warning, that only worked once. When I tried to continue the process the popup blocker bar still came on and I had to click the "temporarily allow" line (MS is presistent in its ways).

I went through all the other steps, everything worked fine and checked out. I will now wait for a day to let GA catch up.

Anyway, I hope this helps some of those that were having problems.

Great code, great solution! Thanks so much for sharing it, fritteritter!!!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Dany, so your popup blocker was hiding the unique word prompt? I just added that last week for convenience rather than requiring the word to be changed directly in the code. I see the same problem in IE 8, so I will have to go back to typing in the unique word.

Glad you caught that, thank you for the reply!


jhamill 6 years ago

Unfortunately this doesn't resolve my issue as I always could see the pop up:(

Dany, it would be great to run some tests with a temporary page etc and confirm that this solution really does prevent the recording of your own visits etc.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

jhamill, if you are trying to install it on a different site with the newest Google Analytics code, could you please post the link so that I can do some trial and error to determine how to fix it? Also please let me know which web browser and version you are using. It still seems to work fine on HubPages in FF, Chrome, IE, and Safari.

Thanks!


jhamill 6 years ago

my link is www.localcomputerfix.co.uk, using IE8 although I think I have tried it with Firefox some time ago as well.

Thanks for looking into this mate. Much appreciated.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Interesting, it looks like your Google Analytics code is identical to HubPages, both use the new async API. I checked your site out in IE 8, Chrome, Firefox, and Opera and each browser shows the proper confirmation.

You mentioned that you could always see the popup. After pasting that code into the browser, the appearance of the popup with your word in it means that your unique word is installed. Have you tried the second javascript: command which checks your browser cookies for that value? If you see the alert there as well, you will be able to use that value for filtering in Google Analytics.


jhamill 6 years ago

Yes, I checked the second javascript command and my word came up as it should.

However I did check in my cookies folder (I am using windows 7 at %userprofile%\AppData\Roaming\Microsoft\Windows\Cookies in windows explorer) and I can't see anything in there. Perhaphs I am looking in the wrong cookies folder?


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

I'm not sure about the actual on-disk storage of the cookies, but if the second command showed your word then Google is logging it to Analytics. That command doesn't use anything Google-specific but rather searches all of the cookies stored for your site. If it alerts the unique word then it is properly installed.

There should be another subdirectory in the Cookies directory called "Low" which might contain the cookie file for your site.


jhamill 6 years ago

Great news, my visits are not recording. Perhaps it was just one of those things where you spend so much time double checking to make sure you get it right, you then inadvertantly undo all of the work that was correct in the first place.

And I found my cookies too. Thanks for your help


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

I understand, I'm glad you got it working. Thanks for the update!


Sam 6 years ago

Hi Fritteritter!

Thank you for your good job. It's easy, simple and effective! Your method is clear and that's very cool.

Thank you a lot

Sam


Mary 6 years ago

I followed these directions, but had to re-enter this for all my browsers, as I have to test my site in many. When I ran the check code, it came back "No Unique Word" in browsers other than FF (Mac) which is my default.

Is this normal?

Cheers, Mary


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Mary, you may have to run the setup code in each browser that you use. However, once you have run that the check code should work. Please make sure that your browsers are not configured to clear cookies - if the cookies are cleared the code will need to be reinstalled.

Which browsers are problematic for you - Safari, Mac IE, and Camino?


IP Address Lookup 6 years ago

Thank you so much .. You Rock!


Gambit 6 years ago

It IS really the easiest. Thanks.


Buy Links 6 years ago

damn you know how to explain. Super simple. thanks


LillyGrillzit profile image

LillyGrillzit 6 years ago from The River Valley, Arkansas

I want to Thank You so much for these Instructions!!! I don't know a lot about codes and the like, and although google gives explicit instructions, sometimes my brain is too full to pay attention until the end. Thank YOU!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Thank you all for the kind words, I am glad the article is still helpful and relevant nearly a year later!


chrysstil profile image

chrysstil 6 years ago

nice hub.


Allan Douglas profile image

Allan Douglas 6 years ago from Great Smoky Mountains, Tennessee

Excellent! Thank you. Much easier than other methods I read about in Google guides.


girly_girl09 profile image

girly_girl09 6 years ago from United States

This is seriously helpful and easy to follow (even I could do it!) Thanks so much!


bizwoo profile image

bizwoo 6 years ago from Nottingham, UK

This is such an excellent hub, thanks a lot for this information. One thing I did not see is that I believe that if you use different browsers e.g. for testing, you need to do this in each of them.

Thanks a lot again.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Bizwoo, thanks for the feedback. I will update the article to emphasize not only that you may need to repeat for each browser you use, but also for each web site domain that you use.


Łukasz Klich 6 years ago

Great tip. Thx


Dany 6 years ago

After three months, I re-excluded after a needed cookie clearing. Worked like a charm and didn't have to disable popup blocker this time!

fritteritter, you're the man! Thank you!


goonman 6 years ago

how long does the cookie last?


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

goonman, the cookie is set with an expiration date 2 years in the future. Each time you visit the page the cookie is refreshed for 2 years from the current date. So cookie expiration by date is only a concern if you install a tracking cookie on a domain and do not visit that site for two years.


Guy 6 years ago

Hi - Thanks for the article: it is the best explanation I have found of how to achieve this. One comment:

In the "How to Check If Your Browser is Filtered Out" section, can I suggest that you highlight that you have to be on the website that you are monitoring, before pasting in the "javascript:alert..." text.

From trial and error, I realised that this is not something that you can copy in simply from the browser: you have to be on the page in question. I know that will sound obvious to some, but it was not from the article.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Guy, thanks for pointing that out. I updated that section to use a numbered list of steps and wording that mirrors the earlier instructions. Now, both the steps and the requirement of being on your Analytics-enabled site are clearer.


Timothy 6 years ago

Hey fritteritter

I have implemented this on the three browsers that I use, and all seems great. Now I want to direct other people to do this too, but as they are less technical I want to send them to a link.

The link 'http://www.lula-isandla.co.za/index.php/remove-fro... includes the identify-authors script with my unique word. However, after visiting that page, and then testing for the unique word, it doesn't appear.

Any ideas? It is a joomla site, but the script is included in the head tag. Is that a problem?

Thanks.


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Timothy, sorry about that but thanks for the example link. There was a typo in the "Automatically identify multiple authors" section code. You can either copy and paste the updated code, or just change the w to a v in _setVar(w) (now _setVar(v)).

If anyone else has had trouble with the script that is pasted into your HTML to provide a link for people to go to in order to be excluded, please try the updated script tag.


Timothy 6 years ago

Awesome. Thanks for the response. Implemented and working! Super rad.


Alexandre 6 years ago

Hello Fritteritter.

I used your solution in IE 8, Chrome and Firefox. When I put the code and click on "enter button" a window with my unique word appears in all the browsers. Then I check if a cookie has been created to be sure that the solution works. I see the cookie _utmv in Firefox only and I can't find it either in IE 8 or in Chrome. What does it mean? That the solution doesn't work in IE 8 and Chrome?


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Alexandre, make sure that you are on the same site in all three browsers. When you run the code in Part 1 the cookie will be saved for that domain name, then you can use the code in the "How to Check If Your Browser is Filtered Out" section to check if that cookie exists.

Depending on how you are checking the cookie values, the browser may not update the actual cookie files immediately. The code in the How to Check... section will tell you if the __utmv cookie is installed properly by reading the cookie from the browser in the same way that the Google Analytics code reads it.


Alexandre 6 years ago

Fritteritter everything work well. Thank you very much. I wasn't on the same site in each browser when I pressed on enter. Now I see the cookies.


John 6 years ago

Dude you rock! I've been through other goog search results and yours is the best. Hope my comment adds up to all the others helping you rank. Thanks!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Thanks for the kind words, nice to know that the title "The Simplest..." has earned its superlative :)


Heat pads 6 years ago

OK, i hope this isn't to dumb of a question, I'm really new to this. If I did the above, and then went to another site that had a link back to my site, for example if i went to Hotfrog dotcom and clicked on a link there, that went back to my site, would analytics count that or not?

I hope that makes sense

Thank you


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

That would not be counted. Normally Analytics would track that as a hit on your site, with the other site as the referring URL. Applying the filtering method in the article will prevent Analytics from tracking any of your personal use of the site.


Heat pads 6 years ago

Thank you for your fast answer. I will be trying this filtering method. Thanks a bunch!


Liat 6 years ago

Great tutorial! Thank you so much! I was able to fix this problem on my blog while begin totally brain-dead - you made it that easy.

One question - this worked on my blog but not on my website (knitfreedom.com).

I use GoDaddy. Are there any cases where this doesn't work? It just didn't seem to save the unique word (and the browser test returns "No unique word."

I appreciate your help!


fritteritter profile image

fritteritter 6 years ago from Ohio, USA Author

Liat, looks like your homepage does not include Google Analytics tracking, but the linked pages (.blogspot.com) do. You can go to one of those pages to set the unique word, but if there is no GA tracking on the homepage you can't exclude traffic there since traffic won't be reported anyway.


Massage Holster 6 years ago

I bookmarked this a while back intending to tackle it when I had plenty of free time. Well I finally did and it took less then 5 minutes. Your instructions are excellent and easy to follow! thank you


Linda Rockwood 5 years ago

Did this process several months ago, worked great! Had to remove and reinstall Firefox today. Went to repeat this process. Doesn't work -- I get no errors, but no box either. Fails in Chrome also. But it does work in IE. Any thoughts?


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Linda, the process should still work in both Firefox and Chrome. Are you sure that you are trying it on a page of your website that has Google Analytics installed?


Linda Rockwood 5 years ago

Hi fritteritter. Yes, I track 5 websites with Google Analytics. I have not touched the analytics code in any of the 5 sites' pages. It's so puzzling that this simple line of javascript is happy in IE, but not in Firefox & Chrome on my computer. Is there something I can try to help troubleshoot this better? If it would help, you can reach me at lrockwoo@twcny.rr.com


BaliMermaid profile image

BaliMermaid 5 years ago from Ubud Bali

I am trying to install this code on my hubpage profile page. Nothing happens when I hit enter. Absolutely nothing.

I tried on other pages, other hubs of mine - still nothing.

I am set up for Google Analytics but this does not seem to be working.

Any ideas?


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

BaliMermaid, I have been working with another reader for the past few weeks to identify some apparent inconsistencies in the bits of Google Analytics used in the scripts above. For no apparent reason, the script was working for her in some browsers and not in others.

This has boiled down to what seems to be different versions of Google Analytics running on HubPages and her personal sites depending on which browser she used. We have gone through about 10 or 15 revisions of the scripts trying to find out what is wrong and how to fix it. I will revise the article if we are able to fix it, not really sure at this time how many people are affected.


Katrina Stovold 5 years ago

Thanks for this. After reading up on other methods, this IS really simple. 'preciate it!


VISHKI profile image

VISHKI 5 years ago

very useful. one question though, what happens when i clear all my cookies? does my computer still retain the word or is it cleared?


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

VISHKI, the word is retained in a cookie called __utmv on each domain where you set it up. So yes, if you delete all the cookies for that site you will have to set the unique word again.

If you are using a program like CCleaner to clear all your cookies at once, see if you can exclude or preserve cookies for your domain(s) so that you do not have to follow these instructions every time. If you have a choice of which specific cookies to keep, be sure to keep any cookies on your domains starting with "__" (e.g. __utmv and __utma)


jeyaprakash84 profile image

jeyaprakash84 5 years ago from Tamil Nadu, India

Thank you very much. It made the process very simple.


james 5 years ago

Great post, very simple


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Thank you to the various readers who have translated these instructions to different languages and to all the blogs, forums, and other communities that are sharing its advice! I have added a section to the article to backlink the translations, be sure to leave a comment if you decide to write your own translation!


Silver Huang 5 years ago

Hi fritteritter,

I installed this on my site by adding your javascript to by tag using the onload function on a separate html page for myself and my family to access:

I also included my GA asynchronous tracking code just before the tag.

When I access this page, I get the popup with my unique word to confirm that it worked. The cookies are definitely there and when I use the second javascript to test for my unique word, it is always successful.

However, my visits to my separate html page are still being tracked no matter what I do, whenever I need to access it from anywhere else other than my own computer, like university computers etc.

Is this supposed to happen? Or does this method not work for for non-hubpages web sites?

Thanks!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Silver, if I understand your comment correctly, you have installed the code on a hidden page of your site, you have visited that page on your home computer, and the unique word was successfully installed. This should mean that any further traffic from your computer on that site should not be tracked.

However, you want to know why your visits to that hidden page from other computers are still being tracked - is that the gist of the question? When you first visit that page, Google will record the page view immediately, before the unique word has been installed. On subsequent visits to that page from the same browser, your visits should no longer be tracked.

If that is indeed the problem, you can create a second filter on the field "Request URI" instead of "User Defined." For this filter, if your hidden page is at www.mysite.com/path/to/hiddenpage.html you would type "path/to/hiddenpage.html" as the filter pattern. That should prevent all of your visits to the hidden page from being tracked.


Silver Huang 5 years ago

Thanks so much for that fritteritter, I do believe that is exactly what I was looking for, much appreciated!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Great, glad to hear it! I will make a note of that in the section that describes creating such a page.


skidogg 5 years ago

I got your code to work with IE Version 6.0.29020,...paste the first line of code, popup with "InternalComputer1", then paste your second line of code, and popup "InternalComputer1".

Then moving over to Firefox 3.6.15, ...paste the first line of code, popup with "InternalComputer1", then paste your second line of code, and popup "admin". I have tried this several times with both my computer and laptop with the same results. I am not adept enough at cookies to know what is going wrong. Thank you in advance, and sorry if you have already answered this. I


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Skidogg, it sounds like you may have followed a similar tutorial in the past using the word "admin." If a cookie already exists for the unique word it may possibly override the "InternalComputer1" code that you just set. This could possibly happen since cookies can be relative to only a certain path of your site rather than the entire site, and a different cookie might be installed on the page you're testing from.

That may or may not be the case, but can you try clearing the cookies for your site and then following the steps again in Firefox? To do that, you can follow the instructions here: http://hubpages.com/technology/How-to-Delete-my-br...


skidogg 5 years ago

You were correct, there was a cookie saved for "admin" and for some reason the code was not changing it. After deleting the cookies associated with the website, the code worked flawlessly. Thank you. I appreciate you sharing your knowledge with us!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Thanks for the follow-up. The article has been updated to suggest clearing cookies if someone else notices the same glitch.


Knowledge Share profile image

Knowledge Share 5 years ago

Thanks for this easy to follow (and implement) advice


DIY Backlinks profile image

DIY Backlinks 5 years ago

Great hub with useful info.


Jodi 5 years ago

Thanks so much for making it easy to understand. Much easier than Google!


Jodi 5 years ago

I tried it on my iPhone and when I paste the code in, I get a message that says:

Safari cannot open the page because the address is invalid.

What should I do?


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Jodi, the code is working for me in iOS 3.2 through 4.3.1 on iPad and iPhone. Could you please check your settings for Safari (Home > Settings > Safari) to ensure that the JavaScript slider is ON? If it is already on, perhaps you have an older version of iOS than 3.2 that does not support these URLs?

From my experience, Android browsers have worse support for this filtering method than iOS. In either case if the javascript: URL will not work, the technique in the "Automatically detect multiple users" section can be used to install the proper Google Analytics traffic exclusion cookies on Android and iOS.


5 years ago

Hi,

I used this code and it worked perfectly the first time, but since then I have changed my website address (I have a tumblr) and decided to redo everything. However, every time I follow the instructions now, my cookies override all of my unique words! I have tried clearing my cookies multiple times, but whenever I reenter a unique word all of the cookies reappear again and override whatever I post.

For example, I will address one unique word x to page A, then another unique word y to page B. When go back to page A to see if the unique word x stands (I type in the code to check for "no unique word") the unique word is B's unique word y. This is even after I have cleared my cookies! It's like once I enter ANY type of unique word, they all reappear again.

Sorry for the rambling, I'm just really frustrated because all of my internal data is showing up on my Analytics page again! Otherwise, this code is very useful. Any insight would be greatly appreciated!

- M


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

M, it sounds like the cookie you add is used by every page on the top-level domain of your site. For instance, if you install the code on example.com, it will also be installed at dashboard.example.com, and if you install it on example.com it will also be installed at example.com/admin.

Is there a reason that you need different unique words? Installing the same word on all of your sites simplifies filtering in Analytics.


chamilj profile image

chamilj 5 years ago from Sri Lanka

Valuable tips! Thanks fritteritter!


Juno 5 years ago

Hi Fritteritter

Thanks a lot for such clear explanations

For some reason it doesn't work for me

The script was run successfully but my traffic is not filtered out in google analytics. I did some additional checks such as:

a) verification script show unique word properly

b) cookies contain unique word

c) i have crated custom report showing my visits and it contains nothing

can you please help me


Juno 5 years ago

additional information

not sure if it is ok or not but cookies contain 2 hosts related to my site 1) www.mysite.com 2) mysite.com

all utm variables are put into 2nd section

thanks!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Juno, can you confirm that your report is set up like this:

Metric: "Visits"

Dimension: "User Defined Value"

and that when you view the report, the date range in the upper right contains today's date? The report will not work if you have chosen "Custom Variable" which is something different. I want to be sure there is a problem before trying to fix it :)


Juno 5 years ago

Thanks for helping fritteritter

Confirm all above

I have made another check. A report was created without filter with the dimension set to "User defined value". The report shows the only record with value = "(not set)"... seems the unique word is not fetched from my web page


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Juno, have you followed the instructions in Part 2 of this article yet?


Juno 5 years ago

Yes I have

During the last report run I temporary switched the filter off since I was trying to see my visits which are aimed to be excluded by the filter


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Juno, the filter permanently removes visits from the report so by removing the filter you would still not see any past traffic with the unique word. Once you have used the web site for some time with that filter disabled your traffic should appear in the report. If it does not, try creating a new page that only you know about. Visit it a few times with the unique word installed, then clear your cookies and visit it a few times again. After a few hours, check if that page shows up in your visits.


Juno 5 years ago

Thanks for your help fritteritter

The cookie has been set up on the page for about 3 days. I will try it again


Juno 5 years ago

yeah

it was an adblock in chrome

probably it should be added to your useful post as i beleive i am not the only victim :))


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Thanks Juno, glad to hear you figured it out. There are a few sparse bits of troubleshooting advice in the article already but you're right that a warning about ad blockers should be added. I will eventually add a Troubleshooting section for easier access.


webstudio2ucom profile image

webstudio2ucom 5 years ago from Baltimore, Maryland

o yes Thanks for helping fritteritter

Did you know that a new version of Google Analytics V5? I wrote in my hub about this story, please read

http://hubpages.com/community/what-are-the-new-fea...


Silver Huang 5 years ago

Hi again fritteritter, how are you?

Your code has been working wonders for me. So far I have been using it on Windows XP and Windows 7, browsers Chrome and Firefox but I just encountered problems with Safari on my iPad iOS 4.3.3 today.

As per your other comments on Safari here, I have checked my Safari settings, Javascript is on, accept cookies is set to always. And I have also cleared my cookies and cache and switched off the popup blocker.

But whenever I load my hidden page with the code installed on it in Safari, I do not get the usual pop up that shows my unique word. And I have run the Javascript test with the hidden page and I keep getting no unique word.

I cannot seem to set a cookie with Safari and yet I am not sure why since this code is supposed to work with Safari too.

Am grateful for whatever assistance you can lend!

Thanks again fritteritter!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Silver, could you please post a link to the hidden page if it is possible to access it without logging in to your site? I will take a look at it for you to see if I can find the problem.


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Since you are using the asynchronous Google Analytics API, it is likely that the Analytics code has not yet loaded when your onload event is triggered. There is a script tag example in the "Automatically identifying multiple authors" section with a timeout that will keep trying until Analytics has loaded. Your other devices probably either have faster connections or have already cached the Analytics code and are able to load it faster than the iPad.


Silver Huang 5 years ago

You're the best fritteritter :) Worked like a charm.

Although there is no popup with my unique word upon loading the hidden page, a quick check with your Javascript test shows that the unique word is there.

Thanks once again!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Ah yeah, looks like slight difference in the two traffic exclusion snippets. I'll fix that the next time the Google Analytics code is updated.


Sarah 5 years ago

Thanks so much for this explanation, it is far simpler than Google's method - and, unlike Google's method, it works!

I just have one question. I chose to follow the instructions you gave under the heading 'Automatically identifying multiple authors' and it's working nicely. I notice that the cookie lasts for 2 years - which bit of the code should I change to make the cookie last longer? I'd like to set it to last for 10 years, if that's possible.

Thanks so much for your help,

Sarah


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Sarah, you should be able to make that change within the Analytics tracking snippet on your page. There are a number of settings here, in addition to your Analytics account you can also send some additional preferences.

If your Analytics code includes "var pageTracker = ..." you should add this line above pageTracker._trackPageview();

pageTracker._setCookiePersistence(10 * 31536000000);

OR if you use the new style code, you will see "var _gaq=_gaq||[];" After the semicolon, add this new line:

_gaq.push(['_setVisitorCookieTimeout', 10 * 31536000000]);

Please let us know if this works for you =)


Sarah 5 years ago

Thank you SO much, that works perfectly! (I use the new style code)

Sarah


Brendon Held 5 years ago

Hi Fritteritter,

Great post and tips. I have been using your code successfully now for quite some time without any problems.

I am not sure if it is just me though, but since upgrading to IE9, I can no longer use the javaScript code to check if my cookie is set. Instead the browser tries to load the code pasted into the URL as if it were a page.

Has anyone else got the same problem, or is it that something isn't set right on my browser?

Thanks.

Brendon


Paul 5 years ago

Thanks so much for this Fritteritter! I set the script some time ago on Safari and Firefox and it works beautifully.

However - I've just installed Chrome and I can't get it to work. I run the script and get the correct response, then I run the check script and it responds with "No Unique Word".

Is it to do with the ad block mentioned above? I can't find an adblocker mentioned anywhere in the Chrome prefs.

OSX 10.6.7

Chrome 11.0.696.77


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Brendon, IE 9 is removing the "javascript:" at the beginning of the link when you paste it in, it appears that you have to type that part back in in order to use the code in IE 9. This is probably some "security feature." I will add a note about this in the article.

Paul, try going to Preferences > Under the Hood > Content Settings and make sure that "Allow local data to be set (recommended)" is selected and "Ignore exceptions and block third-party cookies from being set" is unchecked. It sounds like the browser may be blocking third-party cookies.


Paul 5 years ago

Thanks for that. I can confirm that "Allow local data to be set (recommended)" is selected and "Ignore exceptions and block third-party cookies from being set" is unchecked.

I've even added an exception "[*.]paulhardycarter.com" set to "Allow".

No joy...


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Paul, same versions of OSX and Chrome here and it's still working for me. Can you clear your cookies for the domain? Some people have reported the ability to set the cookie, but once it is set at the domain level, another cookie with the same name but specific to the path you're at overrides it.


Paul 5 years ago

Okay... this is where you see my embarrassed face...

I was using the wrong script. All's well now.

I'll get my coat...


Cony2k1 5 years ago

Thanks a lot for the How To ! I always wondered how to exclude our team from Analytics :-)


Brendon Held 5 years ago

Thanks for the response fritteritter. You were 100% correct. Typing "Javascript" by hand sorted the issue out for me.

Hugely appreciate your help with this!


AlexInItaly profile image

AlexInItaly 5 years ago from Milan, Italy

I'd been pulling my hair out over this one - until I found this article.

Excellent work - being bookmarked for future reference!

Thanks for writing this.

Cheers,

Alex


Nigari 5 years ago

This is amazing! So easy to implement, and easily the best guide for excluding yourself from Analytics to be found on the Internet... Thanks ;)


Nigari 5 years ago

nice...googling for "analytics dont count me" and find this article. Thanks fritteritter.


Martin 5 years ago

Works great! Thank you, thank you, thank you :-)


Katrina Glover 5 years ago

Just an FYI: been using this script great with no problems but recently had to clear out Chrome cookies and re-do everything. Ran into a problem with Chrome also removing javascript from the beginning. So anyone having any issues with getting this to work with Chrome, make sure you go to the very beginning of the address bar and type in 'javascript:' before hitting enter - otherwise you'll just run a google search.


keiju 5 years ago

big thanks


~Romil 5 years ago

Has there been any changes recently?

I used the latest code and Chrome and was able to setup the unique word, however Analytics still counts my visits. Also, every time I restart my PC the cookie gets deleted?

Could this be a Chrome issue? Let me try Firefox and IE and see.


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

There have not been any changes to the Analytics code or account panel that would cause that. It sounds as if you have another cookie overriding that one, at least for certain paths on your site. Please try clearing the cookies in your browser for your site, then set the unique word again and see if the behavior is the same.


Dany 5 years ago

fritterritter, been using this great code for over a year and LOVE it! Thank you! Firefox, however, is becoming a pain with their updates that blot things out and don't work with certain add-ons anymore.

It just did another update yesterday and it blotted out the exclude code yet again. When I checked my analytics just now and found myself included, I redid the code, but no cigar. I copy/pasted as usual into the addy bar, hit enter, and... no box, no nothing.

Popups are allowed for my site, and I also disabled popup blocker completely while doing this just to be sure, also cleared cache, and it still won't work. Thanking you in advance for your help!


Dany 5 years ago

PS - I was necessary to redo the exclude code in Firefox last week (have no idea when or why it got removed, possibly on another upgrade), and it worked fine then, so I'm suspecting something with yesterday's upgrade.


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Dany, thanks for reporting that problem. I checked this out on the latest Firefox on OS X and had the same problem. It looks like Firefox has isolated the data available to the page so that it is no longer available from the URL bar. There is an annoying workaround which I will probably have to add to the article:

In the Firefox menu, go to Tools > Web Developer > Web Console. You will see a > with a blinking cursor beside it. Paste the code in the article then press the Enter key. You can close the web console by going through the menu again, or hit the x button at the top of the console panel.


Dany 5 years ago

Yes!!! fritteritter you're the best! Thanks so much for the lightening-fast response and fix! I love this code!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Glad that it worked!


Thomas 5 years ago

Using latest Firefox. Tried the Web Console solution. How do you test it to ensure that the site is set up with the cookie?


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Thomas, use the code in the "How to Check If Your Browser is Filtered Out" section within the web console to check that.

A more thorough way to check whether your traffic is filtered out of Analytics is to create an "orphaned" page that is not linked to by any other page. Visit the page after following the steps above, then check a few days later to see if the secret page appears in your Analytics.


Dany 5 years ago

Hi again,

Don't know if you're aware of this, and maybe it doesn't matter (other than aesthetically) but when this page is brought up in Firefox, it spreads the exclude and the check your browser codes all the way across the page. The exclude coded even runs under a banner ad and off the page! It's fine in IE and Chrome.


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Thanks Dany. It should be fixed now, unfortunately HubPages is not always the best platform for sharing code.


Dany 5 years ago

Hi there. Yes, this page looks great now. Now for some other annoying news. Firefox seems to be giving grief in all quarters. Using the webconsole route works fine as long as you don't turn off or restart the computer. When you do, Firefox apparently wipes out your lovely code because I start showing up on analytics. So I have to remember on both computers to redo it every time. So far Chrome is behaving itself, so I may have to switch to using THAT browser (sigh).

Any way around that little nuisance? As always, thanks for your great work and help!


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Strange, unless you have Firefox or some computer cleanup software configured to delete all of your cookies, all of the Google tracking cookies should remain intact for at least 2 years. Can you check the __utmv cookie expiration date in Firefox? A plugin like https://addons.mozilla.org/en-US/firefox/addon/edi... could be used to extend the expiration date. Interested to know whether the expiration date is set properly or something else is deleting the cookie... quite a hassle


Dany 5 years ago

I think I found the problem. I went in and looked at the security settings. I had it set to NOT delete cookies, but there is another level where it was deleting them, apparently, on shutdown. I've now changed that (unfortunately the only other options is "until they expires" which doesn't thrill me because of certain other types of cookies), and so far so good.

Btw, how do I check the _utmv cookie expiration? I don't really know how to do that. I tried googling it with no success. I would like to know myself about the expiry date, although it doesn't seem likely that is the issue after what I found. Still...


Dany 5 years ago

Found it. _utmv Expires: March 11, 2012 5AM. Obviously not good for two years. Is there a way to change it?

May still be having an issue, however. Will post when I know for sure.


Cathi 5 years ago

Thanks so very much! It was easy enough that even I could do it.


random 5 years ago

when i try to run this in firefox, i get message : pagetracker is not defined?


Srini 5 years ago

You should open your web site and paste that code.

Guys, how could we use the same code on mobile browser? Is it same or different? When I tried, it is not saying any error or showing alter box with my word.


fritteritter profile image

fritteritter 5 years ago from Ohio, USA Author

Srini, please try the trick suggested in my reply to Sanjin above to make it easier to enable the tracking code on mobile browsers. Be sure to use the most recent code in case anything has changed since that post.


Srini 5 years ago

Fritteritter,thanks for quick reply. I tried that already by keeping that code as link on a sample page. I got the alert message after setting with given value. I have Android OS, still I am not seeing any change. Not sure, are we setting the proper value or not? Or something might be changed with new Google Analytics(GA) code. Still GA is showing my mobile visits after adding the exclude word.


Keith 4 years ago

"Some admin systems such as WordPress may not include analytics tracking on administrative pages. While it may seem counterintuitive, you may need to paste your Google Analytics code snippet into the admin page as well in order to make the above code work."

I have WP and the steps aren't working. I know what the admin page is but I don't know how to paste the GA code in. Nor does it really make sense why I would need to paste the GA tracking code there.


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Keith, in order for the unique word script to work, it has to be used on a page that uses the Google Analytics tracking code. That means that in addition to the unique word script, you would also need to paste the Analytics code used elsewhere on your site. Those steps are only necessary if you have multiple authors and want to automatically prevent their visits from being tracked.

If you are the only author, you can just follow the steps in the first two sections.


Jonathan 4 years ago

Hi, I tried your method, it seems really simple and when I retrieve the word using the code you wrote I get a popup with my secret word. I configured the filter on a profile on Analytics with the same word but Analytics keep tracking my own visits. I am sure I did everything correctly but I must be missing something. Do you have any idea or know about a common mistake that leads to this? Thank you very muchª


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Jonathan, it's hard to guess what might be wrong, have you read the questions and answers in past comments?


Benjamin Welby 4 years ago

Hi fritteritter,

I've tried your method but for some reason I can't get the cookie to stick.

If I visit http://bm.wel.by/stopcountingme2.html and then run the javascript alert I get a pop up giving the unique phrase.

But if I then browse to another page and run the alert it tells me no unique word is set.

I had previously used the method described by Google which used the deprecated pageTracker method and hoped that your instructions would replace that functionality but I don't seem to be having any joy.

Are there any insights you can lend me? Thanks


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Benjamin,

Thanks for posting the link. The problem appears to be that on your stopcountingme2.html page, the Google Analytics domain name is set to wel.by whereas your main site sets it to .wel.by. The latter causes the cookie to be preserved across all subdomains of wel.by - in this case, bm.wel.by. You should be able to fix it by changing this line on the stop counting page

_gaq.push(['_setDomainName', 'wel.by']);

to this

_gaq.push(['_setDomainName', '.wel.by']);


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Just a bit more info... the _setDomainName difference does not actually cause any problems with the cookies; as soon as you load the stop counting page, that cookie is available on your main site. The problem, though, is that Google Analytics deletes all the cookies from the stop counting page when you reload the main page due to the domain mismatch.

I tried running the same JS snippet to install that cookie on a page that uses .wel.by as the domain and the cookie did not disappear anymore.


FrancescoDS 4 years ago

Awesome solution, the script you suggested to Sanjin worked on my iPhone and iPad too (Safari and Atomic Web Browser).


Benjamin Welby 4 years ago

Thank you!


Dan 4 years ago

Hi, can it be that when the script with a Unique Word is used together with the Google Exclude filter that Google Analytics reporting doesn't work anymore?

That's what I did - and since well over 48 hours nothing is reported. Just zeros.

If so, how to undo the Unique Word script?!

Or what may the problem be? Usually I get reports within a few hours.


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

The only ways it could filter out all of your traffic are:

1) if the filter type were something other than Exclude, like Include which would only show traffic from users with that unique word.

2) if the script were added to a public page, so that it adds the unique word for all of your visitors.

I recommend visiting a few pages on a different computer, or clearing your browser cookies and then visiting a few pages, so that you can determine with certainty whether the tracking is or is not working.


Dan 4 years ago

Thanks FR - well still no reporting... The Exclude filter looks fine and the Unique Word script was installed when visiting main page...

Don't quite get this, what you mean with "public page"? Isn't every published page public?

Or does it have to be installed on a private page?


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

If you pasted the code in your address bar it doesn't matter, but if you added the version in a script tag to your html on a public page that would be an issue.

What is the address of the site?


Dan 4 years ago

Hmm thanks fritterritter, think I found the bugger.

In Google Analytics' script the account no. somehow dropped a 0 at the end, so the script I copy/paste first ended with 1-10, but now I saw it's listed as 1-1...

No clue how that could have happened.


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Glad you found it, thanks for following up.


filterama 4 years ago

Hi there. I got to the end, but couldn't find the Available Website Profiles list in the latest version of Firefox.


MIroslav 4 years ago

Hi,

I only managed to filter my traffic on Firefox 10.0.2, I can't do it on IE9, Opera, Chrome (javascript console) and Safari and all of them are new versions of browsers on Windows 7 Professional OS, although it was working before on every single browser.

Do you have any sugestions or did you have problem like this.

Thank you


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

@filterama: The Google Analytics web service was recently updated, and the "New Version" no longer includes the ability to manage filters. At this time it is unclear whether Google is phasing out Filters entirely, or if this is just an oversight in the new interface. You can still add filters to your profiles using the old interface here: https://www.google.com/analytics/settings/home

@Miroslav: do you mean that the scripts do not work, or that they seem to work but your traffic is still recorded? The first troubleshooting step I usually recommend is to delete all of the cookies in each browser for your site. It is common that an old cookie will override the new one due to different paths or domain masks.


Miroslav 4 years ago

Hi,

thank you for answer, but I did deleted cookies and it's still not working, I have a filter at home and work, and it is only working on Firefox (work and home) and Opera at home, other than that, it's not working.

In Chrome I have this message: ReferenceError: pageTracker is not defined.


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Miroslav, can you post a link to the site that it is not working on?


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Thanks for sending the link, it works fine for me in Chrome 17.0.963.56 though. I do see one potential problem on that site which could cause inconsistencies across various browsers.

Your Google Analytics script tag is between the html and head start tags, which is invalid. That code needs to be placed after the opening head tag and before the closing /head tag, otherwise it may be ignored by the browser as invalid HTML.


Miroslav 4 years ago

Yes, I noticed that before and fix it now, but filter code still not working.


Cary 4 years ago

Very clear and concise - even included pics for us visual learners. Much appreciated!


Stuart Edwards 4 years ago

Hi there! Does this tutorial still work with Google Chrome?! Looks really good. Just don't want to run through it all and it not work!

Thanks


louromano profile image

louromano 4 years ago

Excellent! Thank you. Much easier than other methods I read about in Google guides. Great hub.


Tim 4 years ago

Tying that javascript in the address bar may no longer be sufficient, instead your browsers will provide an alternative place to put in the code, for example in firefox it's firefox, tools, web developer, scratchpad

paste it there


Daniel Piñero 4 years ago

Hi. I tried both metods: pasting the code and inserting the script in a separate page (http://danielpinero.com/exclude.html). Then created the filter in Google Analytics.

The popup appears to me with the name "test", but visits keep showing up in Google Analytics.

What could be the problem? Thanks in advance.


CrystalWaters 4 years ago

I do not see the Apply Filter to Websites fields in Google Analytics. Will your solution still work?


Andre Willey 4 years ago

Hmm, I can't seem to get this working on IE9 on either of my Win7 PCs. Works on Win7/IE8 at work though. I tried both the body code and the inline javascript version, but neither actually generate a cookie (I've searched through the file contents in the Windows cookies folder for the wording I was adding). The exclude-cookie code is embedded within a standard page layout on my site, so not sure if something in there is messing with it? Anyway, it's located at www.portorleans.org/exclude-tracking.php if anyone could maybe have a quick look at it for me to see why it does not actually create the new cookie? Oh, I also tried the method of putting the javascript line into the address bar, and while it popped up the correct alert box saying it had worked, still no cookie. Thanks!


Andre Willey 4 years ago

That page I referred to in my last post, www.portorleans.org/exclude-tracking.php, works fine on the same machine using Firefox by the way, and a Firefox cookie is created.

Ideally I'd like to use the inline javascript code version, and just use a bit of PHP to only run it when I visit the site's homepage while logged in as the Admin user (me), then I can just leave it there and forget about it for when I happen to use different machines.


Andre Willey 4 years ago

Oops, please ignore the above two posts, I think it was actually working OK but I couldn't find the cookie file (was in a subfolder). Now working fine in IE9, Chrome, Firefox and Safari - and I even found out how to set up an extra Google Analytics profile which ONLY displays my visits (rather than excluding them) so I can 100% verify the settings are working. Thanks for the help and tips.


pythian2 profile image

pythian2 4 years ago from UK

Great tips and very detailed making no assumption on level of knowledge. I'm off to try it now.

Thankss


Milli Thornton 4 years ago

Thank you for answering my HP question with a link to this page. Much appreciated and very helpful so far. I managed to do the first step easily.

The second part is giving me a problem. I'm not able to access the Filter Manager. Your link doesn't work, and even typing it into my address bar doesn't work. It just keeps defaulting to the home page of my Google Analytics account. Any suggestions?


Milli Thornton 4 years ago

Whoops, sorry. Just realized another Hubber answered my question with a link to your Hub. But that's still good. :~)


Jonathan 4 years ago

This one really works. Thanks!


Mark 4 years ago

Hi,

I've tried this in Firefox, IE and Chrome and nothing happens, apart from Chrome which just does a Google search for the code.

I had implemented this years ago and it worked before, it just doesn't seem to be working now in any browser.

Any ideas?


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Be sure when you paste the code into the address bar that the javascript: portion is not removed. Browsers have started removing this from pasted URLs, probably for general security. You may need to type the javascript: prefix manually after pasting the code.


chowgypsy 4 years ago

Hello, thanks for the concise explanations, but unfortunately I do not have the option to apply the filter to website profiles. I can't access the former analytics interface, either.

Any suggestions?


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

chowgypsy, you can create an Advanced Segment for: Exclude "User Defined Value" Exactly matching your unique word. Unfortunately there does not seem to be a way to enforce the use of that segment, so you may need to reselect it each time you log in to GA. It is possible to create a "shortcut" on your GA dashboard that will apply that advanced segment but I do not think there is a better solution at this time.


chowgypsy 4 years ago

Thanks--I'm willing to try anything!

I made a custom filter and put my unique word where it asked for "filter pattern." Do I need to reselect it frequently if I always stay logged in to GA? i'm not sure what you mean by this.

Thanks for the help!


Jack Dunning 4 years ago

Another novice here. Tried the method and got no pop up. You mention fixes for Firefox and Chrome but not Explorer, if you don't get a pop up. I have Explorer.

Thanks

Jack


Dan 4 years ago

Hi fritteritter,

Using your code since a long time, but with Firefox 16 (for Mac) it doesn't seem to work anymore. No clue why. Not getting a pop-up window. Works like a charm on Safari and Opera.


fritteritter profile image

fritteritter 4 years ago from Ohio, USA Author

Interesting Dan, I see the same thing after updating. Firefox is no longer allowing access to the page context from the address bar. I wonder if that is a bug or a security fix.

Alternatively, you can open the Web Console (Cmd+Alt+K or Tools » Web Developer » Web Console) and paste the same code there.


molometer profile image

molometer 4 years ago

Very useful information, great to get a realistic set of data without the distorting influence of out own activity.

Sharing on twitter.


Mark 4 years ago

I had it working a few days ago, now the code gives an error while trying to set up others to exclude...odd...


Debbie 3 years ago

Hi, am trying to do this in my web browser rocketmelt and am doing it like this :

www.freebiesnetwork.bizjavascript:void(function(w){try{_gaq._getAsyncTracker()._setVar(w)}catch(e){try{__utmSetVar(w)}catch(e){pageTracker._setVar(w)}}alert(w)}('userdebbiefn'));void(0);

this is what am typing on the add bar, is this wrong? please help.

Thanks!


fritteritter profile image

fritteritter 3 years ago from Ohio, USA Author

Yes that is wrong, the www.freebiesnetwork.biz address needs to be removed first.


Jonathan 3 years ago

Hi... this is a great contribution. It works great and it is easier than the bodyOnload kind of solutions. ThankS!


Paul Maplesden profile image

Paul Maplesden 3 years ago from Asheville, NC

This article saved me so much time - It's a simple and elegant way to exclude my cputer from Analytics without me having to constantly update my IP address - Quality content, thanks and upvoted.


Alison 3 years ago

I was able to install the code word perfectly, but I am having a heck of a time with part 2 and trying to find the filter manager within Google Analytics. Have they changed the settings?


fritteritter profile image

fritteritter 3 years ago from Ohio, USA Author

Alison, see this comment for updated instructions: http://hubpages.com/community/Google-Analytics-Eas...


Gregor 3 years ago

hi,

thank you a lot for the instructions. They are by far the simplest and most elegant solution to the problem!


diannetrussell 3 years ago

Hi, all good until "available profiles list". None of my websites are on the list, even though they are all on my google analytics account and I can even see them there on the menu bar at the top of the page! There does not seem to be any way from this page of actually adding profiles to the list....

help!


Ashley 3 years ago

Absolutely the best article I have read on this subject. thank you.


chris desilva 3 years ago

Using Firefox. Tried using the Web Console for Step 1.

Got "ReferenceError: pageTracker is not defined" msg. Can you help?


Robbie C Wilson 3 years ago

Hi Diannetrussell,

I got stuck at the same stage as you, all was good until choosing the profiles which I couldn't do. I visited my profile page and it definitely didn't work. Did you get it working in the end?


Anonymous 3 years ago

To avoid the "pageTracker is not defined" error message, change the code to say "trackPageview" instead of "pageTracker"


Me 3 years ago

Thanks. Finally a really good solution. Piwik uses this kind of cookie and I was really wondering why Google wasn't offering it right away.


Robbie C Wilson 3 years ago

Has anyone been able to get this to work? I am still stuck at the Apply Filter to Website Profiles as it doesn't give me the option. Can anyone tell me what I am doing wrong? I am using IE 9 as my browser...


MP 3 years ago

Everything seems to work fine. Used Web Console in Firefox, and in the Apply Filter to Website Profiles all there was "All Web Site Data" so I used this and it seems to be OK.


MP 3 years ago

Also, for those having trouble finding the filters, click on "admin", and then "all filters". And the "User Defined: in the filter field is way down the list, under "Other".


Libby 3 years ago

Wow! Thanks...easy to do.


ilikegames profile image

ilikegames 2 years ago from Australia

Extremely well designed Hub, I planned to set this up this week sometime so I'll have to test this out then.


GRintage 2 years ago

HEy! I tried to do the first step, but my unique word box wouldn't appear, so I tried to do the blue box suggestion and I don't think that has worked either, when i paste the code in the javaconsole and hit enter it gives an answer in red saying: "Uncaught ReferenceError: pageTracker is not defined" :( what doI do? BLogger stats keep counting my own views and I have tried EVERYTHING, now this... :(


fritteritter profile image

fritteritter 2 years ago from Ohio, USA Author

@GRintage are you sure the page you are trying this on has the Google Tracking code installed? Any chance you can send a link so that I can try it myself?


Nic 2 years ago

Doesn't look like this worked for me. After I made this change I noticed that there is addition of some code to the end of the URLs on my page, so when I share my links they don't look great. The link looks like this:

http://detourswelcome.com/camping-france-maps-chai...

When it should look like:

http://detourswelcome.com/camping-france-maps-chai...

Removal:

I attempted to remove this by deleting my cookies, but the addition to the URL keeps popping up. Any ideas on how I can remove this javascript from my site and stop the addon code to my URLs?

Thanks!


Nic 2 years ago

After some additional digging, I found that the goofy URL addon appears, only when I use Chrome, which was the browser I used to install the javascript code. Firefox seems to work fine.


fritteritter profile image

fritteritter 2 years ago from Ohio, USA Author

Odd, is that .VAgRi2SSyco bit your unique word? Could it be a browser extension that you have installed in Chrome? Your web site does not show a hash like that when I use the code to store a unique word, so I'm not sure whether it is a problem with the site or the browser.

Try opening Chrome in Incognito mode (menu > New Incognito Window) then go to your web site and follow the same steps to install the code. In Incognito mode all of your browser extensions are disabled, so if you still get the strange link addon it is more likely related to the site than the browser.


londonaccountants profile image

londonaccountants 2 years ago from London, UK

Great analysis, thank you for sharing! Now if I could only get rid of semalt!


Sergi 2 years ago

Thank you for your great tutorial. Unfortunately, it doesn't work for me, the message is as follows:

uncaught exception: ReferenceError: pageTracker is not defined

Also tried changing to trackPageview with no success... Help!

Tried with http://www.aestivum.com


fritteritter profile image

fritteritter 2 years ago from Ohio, USA Author

The technique described in this article has been deprecated for quite some time and is not supported anymore in the latest version of Analytics that you are using. Quite unfortunately, the replacement for this single "User-Defined Variable" is a set of "Custom Variables" that are not eligible for filtering (since 2009 when they were introduced). So, the only custom way to filter your data is no longer supported, but it has not been replaced by an alternative.

I tried to hack it by setting the same cookies as the old tracker, but they seem to be ignored once data is set by the new analytics.js Universal tracker. All of the tracking requests are different in Universal Analytics and it just doesn't support this method. IP address filtering is an alternative...


ravinderkumarshar profile image

ravinderkumarshar 2 years ago from india

my google analytics are showing any data. my webmaster tools sub domain is not verify with in google analytics.say as Verification failed for http://hubpages.com/@robin using the Google Analytics method (less than a minute ago). The tracking code used by your site is not associated with your Analytics account. please guide me as i am confused very much.please if possible sent me a email so that i can correct the error. my hub sites 2 hubs http://ravinderkumarshar. thanks


Mathieu 20 months ago

Hi,

I thought of another approach using HTML5's localStorage feature. The advantage over the cookie is that when you clean your browser's cookies, localStorage values remain.

I've written a blog article about it here:

http://www.mendoweb.be/blog/google-analytics-exclu...

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Google is a trademark of Google, Inc.

    Google Analytics logo is from gaforflash, distributed under Apache License 2.0

    Dream/Reality graphic designed by stock.xchng contributor iamwahid

    Screenshots taken in Ubuntu 9.04 using Radial theme.

    Click to Rate This Article
    working