I’ve started my internship at a big school that recently implemented Google Analytics (GA). When we looked at their data we saw that many pageviews simply came from employees visiting gateway pages to internal services. Also, because we don’t have a comprehensive intranet right now many employees and students look for information at the public website. We needed a way to remove all internal traffic from our GA data.
This turned out to be easy. Google Analytics offers this feature right out of the box. On the Analytics Settings page for your account simply navigate to the filter manager and choose the ‘Exclude all traffic from an IP Address’ filter. The fill out your IP range. Some regular expression magic is needed here but there’s plenty of documentation about that to be found. A good tip is to create a new profile for the same website and apply the filter to this new profile so that you never loose any data: you’ll still have your original profile without filters.
Now that we had this sorted out we figured it might be kind of cool to also have a profile that only displays data about internal traffic. Google Analytics doesn’t offer this feature out of the box. Luckily there’s a workaround. Create a new profile for the same website again (add website profile -> add profile for an existing domain), and create a new filter. Make this a custom filter and choose Include as the filter method. Then choose Visitor IP address as the filter field and enter the same IP range you used for the exclude filter as the filter pattern. Now apply this filter to the right profile and you’re all set: you now have a filter that will only show traffic from a certain range op IP adresses. Hope this helped!