Join Corey Koberg for an in-depth discussion in this video Custom filters, part of Advanced Google Analytics.
- [Voiceover] In the last movie we introduced the idea of permanent filters that are applied to the views. Now I want to dive a little deeper and show you beyond the pre-defined filters so we'll head into the custom filters. And we'll also look at yet another great little trick to test and make sure these filters are doing what you think they're doing so you don't have to wait two days to find out the filter wasn't working quite the way you intended. Let's go ahead and head over to the interface here. Now again we're gonna be here in the admin interface We want to go to the view section and click on filters. I'm here in a testing view you never wanna create these filters for the first time in a production one.
So I'm in a testing one. Okay, now last time we took a look at was the pre-defined ones here. We saw some of the ways that we were going to include particular parts of traffic exclude certain IP addresses and so on. Now this time I wanna think what if we wanna do the opposite? What if we actually wanted to only include the internal IP addresses? Now, there's a number of reasons you might wanna do that Maybe you want to understand how the knowledge-based pages on your website are being used by your call-center team. And the beauty of custom filters is we can set them up however we like.
So, we can head over here to custom. Now we've got a few options here as we look at this. We can exclude data, we can include data lowercase, uppercase search and replace and advanced. Let's focus on these first two for now. I said I wanted to include traffic that was from our internal IP addresses so I come down here to include and then I'm gonna figure out what is the thing that I'm running this include filter on? And the field that we're going to filter on is gonna be IP address but look at all of the ones that we've got here. There's an enormous amount of fields that we can apply these filters to.
We've got IP address here but I've got everything from locations to browser size to things that are happenening on E-commerce transactions. Campaign data. I can look at things that are part of what the browser sends back in terms of the host names, the page titles. All the way down, even into things like the mobile device types, social network data and custom dimensions. Now custom demensions are things that I create and so these aren't even things that Google knew about but are going to be able to be filtered on here which is pretty amazing.
Okay, we're gonna head back up here to IP address Now again I wanna find out what my IP address is. So what's my IP? I can copy this in. Now last time in the pre-defined filter it was expecting an IP address. This time, because it's a custom filter and I'm doing this a bit more on the generic one here I need to be able to apply a pattern. What this pattern is instead of being able to just paste that in as it is this pattern is a regular expression and I'm not gonna go to far into regular expressions in this particular course but there is a help section down here if you need to understand a little bit more it will show you how you can specifically deal with an IP address.
The bottom line is I need to escape out these dots and I escape the dots by putting a backslash and so I'm gonna put a backslash in front of each of those dots. And then I'll be good to go. But this is a pattern that we're looking for here not specifically an IP address like we had in the pre-defined. But, if you're just looking for a single IP address you can put that in there and just put the slashes before the dots. Okay, now we can't do a preview here because this is something based on location. But I can put a name in here and say include only internal traffic.
And go ahead and save that. Sometimes folks ask why we can do filters on IP addresses here when they don't appear anywhere else in the interface. You can't do advanced segments and such. I believe that that's because in order to set this filter up ahead of time I have to know the IP address ahead of time and so a little less likely to be abused there and the fact that I have to already be looking for that IP rather than finding out after the fact. But, it is a good thing to note that this is the only place where I can actually do data modification based on IPs. Okay, now I've got another one that I want to point out here another custom filter.
Instead of doing an exclude or an include I wanna go down and hit this one that's a lowercase. Now in this one I'm going to show you why we might do this with a little bit of a silly example but it's all too true. It's also gonna point out a fantastic way to troubleshoot and test your filters in real time. So, in my example here I want to go back to the website and I've got this UTM source and medium here and the source and medium that I've got is a medium of Email with a capital E. And then for source I just put my own name.
Now if we were going to go look at how this would show up I can come here to reporting I can come down to these real time reports and click on traffic sources. And this is gonna show me, in real time who's showing up on the site and filters are applied to these reports. So because I'm in the same view that I've applied that filter to or that I'm going to apply the filter to I can evaluate this here. So if I come back here now I haven't hit enter yet and so I'm gonna start this visit here with a capital Email and the source of Cory and then I'm gonna go back to my real time reports give it just a moment and see that that visit shows up with that particular source medium.
Yup, and there it comes. I've got a medium of a capital Email and the source of Cory. Now I'm also going to open an incognito window which will give me a whole different session. And I'm gonna go back and I'm gonna take that exact same UTM medium and UTM source except I'm gonna do a lowercase email. And I'm gonna wait for that one to show up. And sure enough there it is. Now I wanna point this out it shows as having one visitor who came from the medium of Email, capital E and another visitor came from the email, lowercase E.
In reality, there's no way that I wanna separate those two out. I don't care that it's a capital E or a lowercase E. I wanna know how many people came from that email that I've been sending out. I've got different folks working on it. Some people will type in E uppercase some are gonna type lowercase. In the end, I just wanted to see the email as a medium by itself and I wanna combine both of these emails uppercase and lowercase together. There's almost no scenario under which I want to distinguish those two. Okay, so heading back here what I can do is force those to be lowercase.
What that means is as the data streams in I'm going to be able to have it take the uppercase one and force it down to lowercase. When it does that then both of those are going to appear in that same field. So I can come here, I've got all my campaign ones here so in our case we're gonna do Campaign Medium and we're gonna force that to lowercase. I'm gonna call this Force Campaign Medium Lowercase.
We save that, it's in effect. Now I'm gonna go back here I've got my uppercase Email and actually I'm gonna give it another one I'll call it Email Two so we can distinguish it. I'm gonna hit enter on that which will start a new session. Then I'm gonna come here and what we're looking for is that Email Two to be forced to lowercase. And there it is. Now you see I've got a capital E here but when I look at the report it shows up with a lowercase there. Now I'm gonna go back to my incognito window for just one second.
And I'm gonna do the same thing I'm gonna have lowercase email two. And now I've got these two different sessions one of them, which was sent here in the browser with a capital E and the other one with a lowercase e. And what we see here is Email Two captured them both and because they were both exact same thing by the time it entered into the actual data store here because the filter had lowercased that I see what I wanna see which is I have two visitors who came from the Email Two and that same source rather than splitting those out one and then the other.
And like I said I really have never seen any case as long as I've been doing this where I would wanna separate those by uppercase and lowercase so I recommend that you apply a lowercase filter to all of your campaign variables campaign mediums, campaign sources, campaign names. I would say even think about some of the other keywords and other ones that are gonna come through but particularly medium source and name should all be lowercased it will solve you so many problems of trying to police that within your organization or remember which ones have camelcase or which ones are upper, which ones lower just force everything to lower.
And then all of your reports will be that much cleaner in terms of your data and that much more accurate. So hopefully you're starting to see how these view filters are really useful. Now these are the only places we can touch IP addresses. It's a great way not just to strip out the internal traffic but we can also take a look at how we can clean up that data before it even hits the account. Now again, particularly by using these lowercase filters. Now next time we're gonna take a look how we use the advanced filters and we're gonna set that up to be even more powerful than what we've seen so far. But for now there's quite a bit you can do here with what we've seen today in these custom filters.
Learn how to set your account up for multiple users, structure properties and views, and configure the back end of Google Analytics—including a popular WordPress CMS plugin for automating tracking code on WordPress pages. Corey shows how to apply advanced filters and segments (and customize them to fit your needs) and import custom data sets. He also covers debugging and troubleshooting techniques that allow you to fix Google Analytics issues from under the hood, and he reviews the major segmentation and analysis pitfalls to avoid.
Note: This course picks up where Google Analytics Essential Training leaves off. If you have questions about how Google Analytics works straight out of the box, see those tutorials for more information.
This course is part of a Learning Path approved by the American Marketing Association.
Gain the skills you need to become an AMA Professional Certified Marketer (PCM) in Digital Marketing by using the industry-leading courses and resources in the Learning Path. Take the AMA certification exam to show that you have what it takes to lead the digital transformation.
- Setting up a Google Analytics account for multiple users
- Working with the WordPress CMS plugin
- Using custom and advanced filters
- Debugging and troubleshooting Google Analytics
- Using the advanced Tag Assistant
- Setting up advanced segments: custom, user, and sequenced
- Avoiding segmentation pitfalls
- Generating better reports and insights from Google Analytics
- Importing custom data