How to Filter Yourself in Google Analyitcs
Internal traffic is one of the most common reasons for inaccurate data in Google Analytics. Once this traffic it is recorded, it is really hard and in some cases almost impossible to detect, so it gets easily mixed with your real user data.
What is Internal Traffic?
Internal traffic is all the data generated by you or any member of the team working on yours or your company website. These hits are registered in your Google Analytics as if they were coming from a real visitor.
This can make a lot of damage, especially in small-medium sites, because later is hard to differentiate which visits are real and which come from people working on the site. That is why it is very important to filter all the IP addresses from your team.
What is an IP address?
An IP address is a number that uniquely identifies networks, computers and other devices. There are 2 types of IPs public the one that identifies you through all the internet and private the ones used locally.
The one we will be using is the public IP and you can find it here or by searching "my IP" in Google. You will see something like this:
- Format IPv4: 12.345.678.90
- Format IPv6 2e22:0:10e2:2:c4bc:8fd1:974f:cf19
Depending on your internet service provider (ISP), you may have a:
- Static IP (doesn't change)
- Dynamic IP (constantly changes)
If you are not sure which one you have you can ask your service provider or check every few days if you have the same IP.
Below you will find the instructions to exclude static IPs. If you have a dynamic IP check this guide.
Need help setting up a robust and reliable reporting for your website/business?
Excluding Internal Traffic with Static IPs in GA
A couple of tips to save you some time:
- You need to filter networks not devices: When you filter an IP address associated with a network/Wifi, you will filter all the devices connected to it, your phone, tablet, laptop, etc.
- When testing your site in mobile devices connect to the wifi: When you use your mobile data internet your provider assigns you a different IP each time you connect, so if you want to test your site on mobile devices I recommend you to do it through your wifi, that way you will be able to filter your traffic using the methods below.
How to create a filter for internal traffic
You can exclude a single IP or a series of IPs in the same filter. To do that you need to add a pipe or vertical bar | after each IP like this (only between the IPs never at the beginning or end of the expression)
Note: Dots are considered special character in REGEX, so strictly speaking, you need to add a backslash before every dot like this 12\.345\.69\.0 to escape it. However, this filter can work without them.
Once you have your public IP or expression with multiple IPs, you can create the filter.
- In the Admin Section under the VIEW column, select the view where you want to apply the filter from the dropdown and click on Filters
- On the filter window, select Custom as Filter Type.
- Under Exclude select IP Address as Filter Field.
- Copy your IP or IPs expression in the Filter Pattern box.
- Enter "Exclude Internal Traffic IP" and Save.
2 How to exclude a range of IPs in Google Analytics
If you are in a large company, it's likely that you will have a range of consequent IPs, to avoid haveing to enter every IP you can create a filter with a more advanced regex.
(Don't confuse with the internal IPs, If all the computers use the same Public IP you should use the first method)
- Follow the first 3 steps of the single IP filter above.
- To create the IP range REGEX, we will use this Expression Builder
- Copy the expression generated on the Filter Pattern Box
How to test an IP filter
You can't verify IP filters with the built in verification feature or by using a segment because Google Analytics doesn't store personal data of your users.
To test your filter visit your site from the location you just excluded and check if you are not showing in the real time report, if you still see your visit, wait some time, it may take up to 24hrs.
If your filter doesn't work after this period, check if you enter the correct IP or if you have a misplaced or extra character in the expression.