Often times clients of mine will see large spikes in site traffic at the beginning of their websites life. This large amount of traffic shortly after a sites release gets people excited and expecting equal growth very quickly.
Often times, companies will send out press releases or internal emails to their employees when a site launches. Sort of like “hey guys, go look at our new website!”
This internal traffic registers in Google Analytics as unique visitors, and traffic levels spike. As soon as the initial blast of activity dies down, site traffic slows significantly, and some clients panic. What happened?!?!
The large surge of traffic is often times internal traffic. As developers, we’re constantly tweaking things around launch, constantly refreshing the page. This could go on for days. All these hits register with Google as unique visitors. We don’t necessarily want this though, do we? We want our Google Analytics reports to reflect external visitors – potential customers.
So how do we remove ourselves from Google Analytics reports?
Removing Single IP Address from Google Analytics
Fortunately, Google had made this fairly easy on us. Unfortunately, Google doesn’t keep legacy IP address data on site visitors so we can’t go back and remove certain visitors, we can only remove them going forward.
- Log into your Google Analytics account.
- Click on the Admin tab.
- Drill down until you’ve clicked on the specific Google Analytics profile that you are interested in.
- Click the Filters tab.
- Click the +New Filter button.
- Choose Create new Filter and choose a unique name (perhaps include the date).
- Next to Filter Type choose Custom filter.
- Choose Exclude.
- Choose IP Address in the Filter Field.
- In the Filter Pattern field, enter a regular expression for the IP address.
For a single IP address, it’s rather simple. Let’s say you have an IP address of 127.0.0.1 (I know, I know…this is localhost and you would never get traffic from here – this is just for an example), you would enter
- Click the Save button at the bottom of the page.
The form should look similar to this:
That wasn’t too bad, was it? Let’s test out to make sure that our filter is working properly. If you blocked your own IP address, you can now refresh your website and go to the Real Time -> Overview section of Google Analytics to see live traffic. If you see yourself navigating around the website, then you likely have gotten the IP address incorrect, or your traffic is coming from an IP that you didn’t exclude.
Excluding a Range of IP Addresses
To exclude a range of IP addresses, you’ll want to write a regular expression to include the range. For example, if you want to exclude 127.0.0.1 to 127.0.0.255 then this would be the value you enter in Filter Pattern.
Not familiar with regular expressions? Google has a nifty tool that will help you generate the regex that can be found here: http://support.google.com/analytics/bin/answer.py?hl=en&answer=1034771.
Again, remember to test your filter to make sure that your traffic isn’t being recorded in Google Analytics reports.