Sunday, April 25, 2010

Google Analytic: Using Cookies to Filter

Many computers use dynamic IP addresses- that means the IP address of your computer changes, it is will change, so using the IP address to block views might not help. When I described how to filter your views from Google Analytics, I forgot to take this into account. Coltpixy on ArtFire described how to use a cookie to be sure you exclude your views from your shop. This will work only on a computer with the cookie installed and if you delete your cookies, you will need to re-enter the cookie.

You can set a cookie to exclude yourself from Google Analytics.
Copy the following line of code replacing my "shopname"  with your own shop.

Code:javascript:pageTracker._setVar('Shopname_exclude_me');
Go to your shop. Paste this  copied line of code into your location bar at the top of your web browser, the place where you enter website URLs and currently see your shop URL. Press Enter. The cookie is now set.

Now, you need to tell GA to exclude any traffic from browsers that have that cookie. On the first page when you log into GA you will see in the lower right hand corner, "Filter Manager." Click this.
In the gray bar that says "Existing Filters," Click the "Add Filter" link.

Fill in the page as follows:
  • Filter Name -- Type any name you choose here.
  • Filter Type -- Custom Filter (and make sure the Exclude radio button is checked)
  • Filter Field -- User Defined
  • Filter Pattern -- Change the store name to your own of course, then type in the following

Code:shopname_exclude_me
Then be sure to click the radio button that says "not case sensitve"

In the "Apply Filter to Website Profiles" section, highlight your site in the box on the left, the click "Add" to move it to the right. Click "Save Changes"

1 comment:

Anonymous said...

This was very useful, thank you for blogging about this.