How to Exclude Internal Traffic (IP addresses) from Google Analytics Data (UA & GA4)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right here we are and in this video we're going to cover how to exclude internal traffic from your google analytics data and reporting so that includes excluding your own ip address your team members or any traffic coming from your organization that way your internal traffic won't contaminate your data and you won't make decisions based on inaccurate data first things first we're going to talk about reporting views and when we exclude internal traffic we'll actually create a new reporting view with that in mind so it's best practice to have a reporting view with your raw data all the data that you collect for this ga property we just want an unfiltered view unchanged no type of filters that might alter the data in any way ideally you would be testing and validating your data in a separate reporting view perhaps a staging or a qa reporting view but sometimes you might end up implementing something in your production reporting and realize that it was a mistake or you need to revert it back you need to change it so if there is something if you do end up messing up a production reporting view you can always refer back to this all website data this this raw unfiltered reporting view this will give you a backup of your data and you can still use segments build out segments to obtain the data that you're looking for so if you click on this drop down at the top we can see by default whenever we create a a new web property it gives us this reporting view all website data so let's click on admin and we'll keep this reporting view but we'll also create a new reporting view and we'll call this well let's first create a reporting view for qa for quality assurance purposes let's change the time zone create view and then we'll create another one for master this will be the production you can call it either production or master reporting view we'll change the time zone again create that view and then we'll actually see that we have now three reporting views all website data master and qa so the first reporting view all website data will be the raw unfiltered data we'll use master as our production reporting and that's where we'll actually exclude internal traffic and for this qa reporting view we actually want our internal traffic because that's where we'll test ga configuration we're going to cover two scenarios each for both google analytics universal analytics and google analytics 4. the first being you want to exclude a single ip address maybe you just want to exclude your own ip address the second being you want to exclude a subnet or a range of ip addresses that means there are multiple internal users at a single location using the same network so this would exclude those users from that ip network from your google analytics data so it's in this master view where we'll create a filter to exclude internal traffic so click on add filter and in the filter name field we can type exclude internal traffic now for the filter type we'll use we'll stick with the predefined and choose exclude and then we'll select the source or destination and choose traffic from ip addresses for this last drop down select expression choose that are equal to and type in or paste your ip address and save that so that'll exclude only this ip address if you want to exclude a range or a subnet of ip addresses change this last drop down to that begin with and then enter the first portion of the ip addresses for the subnet that you want to exclude and then you can save now if the ip addresses are a little bit more complex you can use regular expressions or regex and for this what you'll have to do is change the filter type from predefined to custom keep it on exclude and for the filter field look for ip address and in this filter pattern here you want to copy and paste use a regex that look something like this we can actually get rid of this last character i'll break this down quickly and we'll use a site that i like to use a lot called regex101.com or 101.com and so this allows you to test your regular expressions and test values that that meet the condition that meet the regex so i pasted the regex here at the top and to break this down this carrot this first character indicates the start of the expression so we want our expression to start with the remainder of the expression and you'll notice that there are parentheses that are color coded so those matching parentheses represent a group so the first parenthesis the open parenthesis represents the first group and the second it's colored differently is for the second group and then this yellow is for the third group and so on and so forth so our regex begins with the ip address starting with the one two three and then there's this backslash before this period so i p addresses normally they look like this but in regex what a period represents is any single character so in order to say okay i want a literal period what you have to do is use a backslash before the period so we have one two three and then period and then we go and create a group a couple groups for the remainder of our ip addresses so for this for this second group and third group we have four five again backslash literal period and 678 and that this closes the third group and then there's this this bar character that represents or so we have this basically this first part of the ip address from 123.45.678 and then we have this or for the second group so it can be either 45.678 or 90.123 so basically the second group is covered here in group three as you can see it matches the first group or it matches the first condition and then group three so if we wanted to match the fourth group here with the nine zero and one two three we can type nine zero one two three and you can see that matches the fourth group and then the last part again we have another backslash because we want another literal period and then we're looking for this range any single character that that falls within this numerical range zero through nine and an asterisk which is looking for the previous condition so this zero through nine range and is looking for it in between zero or an unlimited number of times so this last part 9.90 meets that requirement and so these two these two ip addresses would satisfy this regex and you can see here how it matches so match one that matches the entire thing and then you can see the the different groups the different portions of the expression and what conditions it matches if you want to exclude internal traffic in your ga4 property go to your admin settings and under the property column click on data streams click into the data stream that's applicable scroll down go to additional settings and click on more tagging settings then under tag configuration click on define eternal internal traffic and create a new traffic rule you can name this rule internal traffic just keep it simple and if you have a single ip address that you want to exclude you can choose the drop down options and click i p address equals consult the ga4 documentation and take a look at this documentation and some of these examples here then input your ip address if you have a range of ip addresses that you want to exclude there are a couple of ways you could do this you can either add a condition and choose the appropriate condition you want to add so you can choose ip address equals again or ip address begins with whichever one you see fit i've never used the cidr notation but if you want to see some examples you can consult the ga4 documentation and take a look at this documentation and some of these examples here input the other ip address or you can use the iphs begins with and then only include the values that are applicable so ga4 will treat these conditions as or statements rather than end so it'll check the ip address to see if it meets either the first condition or the second condition so click on create and we see that it's been saved this traffic internal traffic rule has been saved so click out of this click out of that and then go back to your main admin page and click on data settings under the property column after that click on data filters and you'll notice that there is a filter here for internal traffic with the current state set to testing now there are a few states for this filter there's testing there's active and there's inactive and you want to set this this state for the filter to active that way it'll filter out any incoming data from this ga property that meets the internal traffic rule so save and confirm to activate the filter and now your j property your ga4 property is excluding internal traffic so this could look different in the near future because right now for internal traffic when you set the rule when you create the rule you can't use regex you can use regular expressions like you can in universal analytics so that's something to be aware of so that's how you can exclude internal traffic for google analytics universal analytics and for ga4 hope you found this video useful and if you did please like and subscribe leave a comment and we'll see you in the next episode
Info
Channel: Growth Learner
Views: 234
Rating: undefined out of 5
Keywords: Google Analytics, Web Analytics, Digital Analytics, web analyst, digital analyst, digital marketing, digital marketer, User behavior, user engagement, metrics reporting, reports, digital measurement
Id: GxzVNKRLnQE
Channel Id: undefined
Length: 15min 37sec (937 seconds)
Published: Wed Nov 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.