Exclude Yourself and Others from Google Analytics Data: 5 Ways to Do It

These tactics are best for excluding Admin and Testing visitors.

That means you, your co-workers, your clients, or anyone else you know, but don’t want in your results.

Most of My Suggestions Use Google Analytics Filters

Filters are used on a hit basis. That means every pageview or event on your site will run through your active filters before being added to Google Analytics reports.

To see what Google has to say about Profile Filters check out their support page.

I recommend creating multiple Profiles under your Property (website).

I always keep one profile with no filters. For my site I just have a Raw Data profile and an Exclude Admin profile.

 

Exclude IP AddressIP filter capture

Filtering out IP addresses is a great way to remove visitors that always access the site from one place.

I have provided a basic example to the right. If you are at an office that uses a range of IP addresses, use this great IP address range tool that Google has provided. This way you can exclude a range of IPs with just one filter.

Downfall: Laptops

Filtering IPs for desktop computers is great. Those IPs rarely change.

Laptops on the other hand change every time you connect to a new network. If you work in coffee shops like me this filter will never be a great solution to excluding yourself from Google Analytics reports.

 

Exclude Internet Service Provider (ISP)

internet service providers capture

If your company or a client has their own Internet Service Provider this is a very easy way to exclude that traffic. Large companies almost always have their own ISP. As an example, see the image to the right. All those institutions have their own ISP.

Downfall: Internal Applications and Huge Corporations

If you exclude a whole ISP you might miss out on data you didn’t mean to exclude.

For example, you build a website for management at a corporation to communicate to their sales team. Traffic from management needs to be excluded from Google Analytics reports so you exclude the corporate ISP. You would also miss out on most visits from the sales team since they share the same corporate ISP.

 

Custom Tagged Campaign Links

This is my favorite way to exclude visitors from Google Analytics reports. It’s simple, non-technical and works for anyone, anywhere, anytime.

This filter excludes traffic that enters your site from a tagged campaign URL link. I wrote about Custom Campaigns a while back if you want to learn more about them.

 

Here’s What You Do:

HideMe Filter Capture

  • Setup a new filter that matches the one to the right.

Don’t skip this step or the rest are pointless.

  • Use this URL Builder provided by Google to create a tagged link.
  • Enter your homepage or any sub-directory in the URL field.
  • Enter these values:
    • Campaign Source: Testing
    • Campaign Medium: Link
    • Campaign Name: HideMe

The link should look like this: www.dirtyanalytics.com/?utm_source=Testing&utm_medium=Link&utm_campaign=HideMe

  • Use that link every time you want a site visit blocked from analytics

You can send this link to co-workers or clients. The great thing about it is they don’t have to understand how it works. Just make they use the special link every time they access the website.

I recommend adding a bookmark to your browser and using that every time you visit the site.

Downfall: You have to click on the tagged link.

Every time you visit the site you must use the tagged link to be excluded. This get’s old fast.

This method is best as a bookmark on your browser.

 

Universal Analytics Custom Dimensions

This only works if you are using the Universal Analytics tracking method.

This is the most difficult method, but is very effective.

It works by adding a cookie to your browser that will last for up to 2 years if you don’t delete your cookies. All you have to do to set that cookie is click a link on a hidden page. The link sets the cookie and redirects you to any page you choose.

Here’s What You Do:Custom Variable Filter Capture

Make the custom dimension User level. Name it something like “Hide Me Tagged Visitors“.

  • Write down the Index of the dimension. You need it later.
  • Add the filter shown to the right to the Profile you need to exclude these visitors from.
  • Create a page on your site that is not accessible through any menus.
  • Add the following code to that page. It will just show the words “Click to Set Cookie” when you view it in a browser.

<a onclick="ga('set', 'dimensionX', 'HideMe');" href="URL">Click to Set Cookie</a>

Replace X with the Dimension Index # you wrote down earlier. Replace URL with the homepage URL.

  • Once this link is clicked the browser you are using is tagged until its cookies are deleted.
  • Repeat this anytime you switch browsers or delete your cookies to stay hidden.

Downfall: This Only Works in Universal Analytics

Pretty much self-explanatory. This doesn’t work with the classic Google Analytics tracking method.

Other than that it’s pretty awesome. All you need to do is click a link and your browser is tagged for up to 2 years.

 

Google Analytics Opt-Out

google analytics opt out icon

If you don’t want to worry about setting up any filters this is the option for you.

Google provides a browser add-on that will disable Google Analytics tracking on that browser. This disables Google Analytics on all websites. You can download it here.

You can also find some unofficial plugins that will let you choose which website to block like this one for Chrome.

Downfall: No Testing

This method blocks Google Analytics. You can’t set up a “Raw Data” profile that will show your activity. According to Google Analytics, you have no activity. This raw data is really helpful in testing your tracking and you lose that option if you block Analytics tracking.

Also – I also don’t mind sending my data to Google Analytics. It’s anonymous and it helps site owners make their sites better. If I don’t send them data that hinders their testing efforts as well.

 

comment bubbleIn the Comments

Please leave a comment if you have any issues implementing these. I want to cover everything.

Also let me know which tactics are your favorite, especially if they are not listed in this post – I’d love to hear.

32 Comments

  • Tnx – Google opt-out was just perfect! Totally suits for me + easy (5 sec and done).

  • Hi Jake,
    Quick question, when creating the page for the code :”Click to Set Cookie” are we talking a basic .html page with only that code or should it also include the universal analytics code snippet?

    Thanks for the great article,
    Le

    • Hey there, you’ll need the GA snippet on the page too. It’s using the GA javascript library to set a flag on your cookie

  • Opted for the Custom Tagged Campaign Links. Looks like it will work. Thanks. My ISP change my IP daily and the ISP is national, so I can not exclude their IP range. Why can Google not write articles like this?

    • BTW, I only use bookmarks so access my site, like speed dial on Opera, so this is perfect if it works!

  • First of all – great post! So far the best explanation I’ve found on setting a Cookie in order to exclude myself on my site. I’m trying to set up the Universal Analytics Custom Dimensions but unfortunately it does not seem to work.

    Can you tell me if I also need to set up Custom Metrics? The problem is that in the Filter settings I don’t see the custom dimension in the Filter Fields. I can’t find “Hide Me Tagged Visitors” event though it’s the name of my Custom Dimension.

    Any idea on how to make that work? And will I also be excluded from realtime tracking?

  • Ah – got it to work. Had to select the filters in the “View” settings and not the “property” settings. There the Custom Dimension shows up in the Filter List.

    Will the filter also work in the real time view? As I can still see myself there…

    • Hey there – yea the real-time reports don’t obey filters, but the other reports will

      • Thank you – it seems to work so far. But about the real-time reports and filters: If I exclude an IP range it also works with the real-time reports. But I won’t use that as the range is too broad.

      • One more question – is there a way to test if it is really working? So far I keep seeing myself in the reports… Any way to make sure the custom dimension and the filter based on it works?

  • Hi there! really wonderful post 🙂
    Unfortunately I’m using a CMS for my website, so I can’t just add a regular html page. That forces me to add the Java Script into a page through an HTML iFrame. Now after clicking on the “Click to set cookie” – I just see “404 not found” error within the iFrame and of course – none of the filtering process occurs. How can I overcome this? Thanks! 🙂

  • Hi Jack, great post!
    I wanted to tell you that when I’m using the the custom dimension method, and after clicking on “Click to Set Cookie”, then I get a 404 not found page. Does it still activate the cookie? Thanks a lot 🙂

    • Hey there,
      It seems like this would result in the cookie not being set. Is there anyway you could use another method?

  • +1 for Malte question. Great post and I wanted to test “Universal Analytics Custom Dimensions”. I’ve set it up but I do not know how to test if it is really working and filtering my visits. Do you have any suggestions?

  • Finally made it to work. ga(“set”…) must be called before ga(“send”…), so it will not work on link click as it is. I’ve simply put ga(“set”…) in head of the page inside google analytics sript before ga(“send”…) line and now it works. Alll we need is to load that page.

  • Hey Milan, could you please put a complete code example of what you did? Thanks!

  • Hello, I have tried several times but my answer is not appearing. Probably because of code. If you can leave me any other way to contact you I will share it with you.

  • When you create the Custom Dimension it gives you some code to add to the tracking code. It says not to forget to replace the Dimension Value with your own. I’m not sure what goes in that spot. Using your example is it “HideMe” or “Hide Me Tagged Visitors” or something else?

    • Hey Bill, You should use the dimension index #. You should be able to see that by clicking on Custom Definitions > Custom Dimensions in the GA admin. Then there will be a list of dimensions and one of the columns shown there is index!

  • […] There are different options to remove yourself from getting into your website google analitics stats. See here. […]

  • I found myself in this same dilemma not long ago. Didn’t want to hard code anything because I only wanted to filter the admins during certain periods of time and altering the code over and over would be a headache. IP filtering didnt work as our team was working from many different locations with dynamic IPs… Then plugins suchas Yoast and others had way too many options for my simple goal, so I created this plugin

    http://codecanyon.net/item/google-analytcis-by-users-and-roles/12168848?ref=mirlostudio

    It will add your GA code to all pages and give you the option not to track handpicked users or roles.

    Hope somebody will find it useful! 🙂

  • Excellent article!

  • I had to do the steps you describe in “Exclude IP Address” so often that I created an open source tool for it. It automatically reads your IP and creates an exclusion filter for it. Maybe you’ll like it! It’s at https://www.excludemyip.com.

  • Other than depending on google’s own ‘stuff’ to block itself, is there another browser add-on or setting in our firewall* that we can use to block google analytics? It slows down our browsing and makes us resent google, every time we see that the page we are trying to view is loading/reading google analytics. We have never opted In for such snooping, we hate google, and we want the snooping to stop. HOW?

    ___________

    *We already have a firewall rule to block (known) google IP numbers, but it’s not stopping google analytics.

  • […] Exclude Yourself and Others from Google Analytics Data: 5 Ways to Do It […]

  • I used your custom tagged links method on my home page link. My question is, do I have to create a url link for every single page I want to access on my site or am I in hiding as long as I enter my website through the link I created for my homepage? Thanks for the resources.

  • Unless I am doing something wrong the “Custom Tagged Campaign Links” method is only working on the landing page. Once the internal user using the URL navigates away from the landing page, all actions are recorded normally.

  • To followup on my previous comment. I know it’s been said, but Real Time stats are NOT reliable when testing this. Instead, once the pages are hit I was able to wait about 10 seconds and have the stats show on Behavior>Site Content>All Pages. So, I was wrong, the Campaign method does appear work as intended.

  • Nice post, thank you.

  • Thank you very much! Quick and easy way to get what’s important in getting rid of unwanted data in analytics.

  • Great Article! Thanks!

  • Thank you for all of the info! I ended up using a custom campaign link.

Leave a Comment