Exclude your IP address in Google Analytics for tracking
Are you a new website or blog and are you looking to track your website traffic? Have you been wondering how much of your incoming traffic is accounted for by your own clicks, either while creating the blog or while testing it? Or are you looking to exclude the traffic from your employees as well? In the following blog, we’ll be discussing how you can block or exclude a single IP address or multiple IP addresses in Google Analytics.
Once you have your website linked with Google Analytics account, Google automatically starts tracking any incoming traffic to your website. Now, this traffic also includes any click that you make from your own device while testing the page. Ideally, in order to get an accurate count of the users, the self/test clicks should be negated. In order to do this, Google Analytics provides the option of excluding your IP address.
Steps to exclude single IP address in Google Analytics
Here are the steps to filter your IP address from Google Analytics:
- Login to your Google Analytics account.
- Click on the Settings tab (located at the bottom of the left pane).
- You’ll be navigated to your accounts page. Click on ‘All filters’ under the accounts tab.
- In this page, you’ll find an option to ‘Add filter’. Click on. Add filter.
Adding Filter to remove IP address from Google Analytics tracking
- Provide a name for your filter.
- Select the filter type. In this case, it would be: exclude traffic from IP address that is equal to x.x.x.x.
- Next, select the view to which you want to apply the filter. And click on Save.
Note: In order to get your IP address, all you got to do is search in Google “My IP address”. Google will fetch it for you.
How to exclude multiple IP addresses in Google Analytics?
If you’re tracking for an organization and you need all of your internal traffic to be blocked, you would need multiple IP addresses to be excluded to be excluded in that case. There are a couple of ways of doing that –
- Create multiple filters with each IP address (ineffective and time-consuming, also not applicable when the list is huge)
- Create a single filter with an IP pattern (preferred)
We would be following the second approach to exclude multiple IP address in Google Analytics. Below mentioned is a step-by-step procedure.
Create an IP Address Pattern
- Go to google.com
- Search for ‘ip address regular expression generator’. You’ll find multiple tools available to use. I prefer this.
- You’ll find a page with the following options –
- Enter your range of IP address in the two steps mentioned above, with Step 1 being the starting point of your IP range and Step 2 the end. Click on Generate RegEx to generate the IP pattern. Copy the IP pattern generated.
- In Google Analytics, in the Settings tab, under your Account, go to the Filters tab
- Click on Add a New filter.
- Provide a new to the newly created filter.
- In Filter Type, select ‘Custom’.
- Under ‘Exclude’ in the Filter field dropdown, select ‘IP address’.
- In the ‘Filter Pattern’ paste the IP pattern that was generated using the tool. Save the Filter setting.
That’s it. You’ve created a new filter for your account which is going to filter out a range of IP addresses.
How to get visitor IP address in google analytics to exclude them?
Does Google analytics keep track of the incoming IP addresses? The answer is NO! Google doesn’t reveal the IP address of any incoming visitor to the website. However, if you want to deliberately exclude a particular visitor’s IP address in Google Analytics, the process would be manual. From the backend, back on your server in place and other Analytical tools being used, this detail can be easily retained.
If you’re using PHP, acquiring this data would be pretty easy. All you got to do is run this script to get the user’s IP information:
echo ‘User IP – ‘.$_SERVER[‘REMOTE_ADDR’];
What are the other options for filtering data in Google Analytics?
The following are some of the custom filters that you can create in Google Analytics:
- Exclude – This filter excludes the user records or hits that match a particular pattern
- Include – Contrary to above, this filter includes the user records or hits that match a particular pattern.
- Lowercase/Uppercase – This filter in Google Analytics converts the content of the field to either all Lowercase or Uppercase. This filter is only applicable to letters.
- Search & Replace – As the name suggests, this filter to used to find a particular pattern within a field in Google Analytics and replace it with an alternate form.
- Advanced – This type of filter allows you to build a new field from the existing fields. To learn more about this filter, check the Advanced filters in Google Support.
In which order does Google Analytics filter data?
The filtering order in Google Analytics is pretty much the order in which the filters are applied or created. The data is processed in a sequential manner starting with the first filter, then the second, and so on.
Conclusion
Excluding internal traffic is one of the most important steps to be followed in order to have a clear indication of the incoming website traffic through Google Analytics. In the above article, we’ve discussed a step-by-step approach to exclude either a single IP address or multiple IP addresses in Google Analytics. We also discussed the various filtering options that are available in Google Analytics.
For more details on how to exclude an IP address from Google Analytics, visit the Google Help Centre here.
Next – Learn how to add Google Analytics code to your website.