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.
- 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!
- 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.
- 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.
- Once you have changed the code, press the Enter key.
- If your unique word appears in a popup box it has been successfully set.
- 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.
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.
- Go to the Google Analytics Filter Manager (you can always find a link to this page at the bottom of your Analytics homepage)
- Click the + Add Filter link which is located at the right of the gray bar.
- Type a filter name, something like My Traffic or Author Filter.
- After Filter Type, 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 that you used in Part 1.
- 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.
- 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.
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:
- Go to any page on your web site that uses Google Analytics tracking.
- Copy the entire one-line code below and paste it into your web browser address bar.
- 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!
- La forma más simple de eliminar tu propio tráfico en Google Analytics (Spanish)
- Comment exclure vos propres visites des stats de votre site ou blog en moins de 5 minutes (French)
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.
- Add the following snippet to your HTML code, it can appear anywhere on the page.
- 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?
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.
- 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)
- Select Add a profile for an existing domain.
- Choose your web site from the dropdown list and name the profile something distinguishing, such as Blog Co-authors.
- 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.
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.