Let's get started with filters now. Now filters are really all about processing
the incoming data. So something comes in we can decide to filter something out, we
can alter the data and then pass it on to the reporting views within Google
Analytics. There's a lot of different stuff that you can do with filters and
it all depends on how you want to split our work with the data. But for a
standard setup, a best practice is to simply install one filter which is the
own traffic filter. Because you don't want to analyze your own traffic, you
want to get insights about your users so filtering out your own traffic is
recommended. And there are really different methods of doing this. Some are not
really filters but we'll start out talking about the IP filter which is the
standard way of excluding your own traffic. But there are some limitations
to this approach. We'ill talk about plugins, how you can filter out your own traffic
with browser plug-ins that you can install or the hosts file approach. And
some more advanced techniques would be cookie filtering or implementing that
via Google tag manager. So let's take a look on how to set this up in Google
Analytics. So just to show you here our admin of our demo account we have
filters available here under our view settings. Once we click on that we can
see all the filters that are implemented. Now if you click on new filter, we will
have different options here. And this is very powerful feature because you can
not only filter by IP address but you could also filter out different traffic
types, such as people come from a different host name subdirectory even in
the custom view you have many different other fields that you can filter off. And
they can be useful but for our case right now we just want to filter the own
traffic which we can easily do by selecting here this filter type. And say
that we want to exclude the traffic which comes from a certain IP address.
And we can choose if we want to exclude an exact IP address. A one that begins
with a certain range or ends with a certain range or that contains certain
values. Now how to go about this obviously you could go into Google just
type in my IP address and it will give you the IP address. You could copy that
and put that into this IP address filter. And then say this is equal to and this
is the IP address we'll give it a name. And you would be all set and done to
have this IP address filter implemented. Now there's a big but here to take
this approach because my IP address can actually change if I reconnect to my
ISP. There might be a new IP address that is assigned to us. And therefore this
will change and I would need to change this IP address filter every time I log
on to the Internet. Now this approach works pretty well if you have a static
IP address. Sometimes this is the case with bigger companies or if you know
your IP address range. So maybe your IP address ranges between several numbers
and you could just say that you want to ask the IP address to begin with. Now
this is really an approach where you really need to know you're IP address
and how it works. So I wouldn't recommend this approach to anyone who
doesn't know exactly how the IP address functions within the organization. If you
want to use this approach and have a little bit more granularity in the way
you filter this IP addresses, you can also
use regular expressions. And this is possible by going to the filter tab
custom and then in the IP address field, you can choose a filter pattern. And this
is really the regular expression that you can type in. If you want to find more
about that you can look into the Help section of Google Analytics. And here
you'll find different examples on how to filter the IP address with regular
expressions. But as I said this is really one approach that you can take.
The other approaches out there not really putting in a filter here but
rather filtering the traffic on a measurement level. So making sure that
the data doesn't even get sent to Google Analytics. And the first thing that I can
recommend here is using a browser plugin.And we have here Ghostery
so once we install this on our Chrome browser, this is also available for
Firefox, we get this little icon here. And once we go to a page and reload that
page, you'll be able to see which tags are installed Google Tag Manager,
Google Analytics, Gravatar. And we can choose to block this tag on our browser.
So once we reload this page, we see that Google Analytics is not active anymore.
And within our reporting view you shouldn't see any activity. It's going to
the real-time reporting and we see there was no page view triggered. Now the
downside of this plugin is really if you go to another page here and have Ghostery
active, you'll see that Google Analytics gets blocked by default on every page
which makes my heart as a web analyst really squeak because this user will be
not visible for Google Analytics anymore on every page. Which is not really a nice
approach to handling this problem but it's a viable method of doing so.
Another quick method of excluding your traffic would be editing your hosts file
so you can go into your system settings of your operating system, such as Windows
or Mac OS and can find the host file. It's normally under etc hosts for Mac
users. And you can put in some blocking rules that will prevent the tracking
code to connect to Google Analytics, the Google Analytics service and therefore
the information won't be sent. Obvious downside the same as the plugin this
will block Google Analytics on every page and you won't be tracked on any
page anymore. Another method that comes to mind if you are big organization and
you have a central accessing system such as a router, you could set up a filter to
not connect to these servers either. But as I said this is really an easy
approach but at the same time you won't be tracked for any site anymore
which really hurts the web analytics community overall.
Now the last approach that I want to present here is first of all Google Tag
Manager there's a great write-up by the guys at Lunametrics.com how to install
filters via Google Tag Manager. This will also prevent the data to actually been
sent to Google Analytics. This would go into far too much detail to show here
but what you can essentially do is all the IP filtering can be done on Google
Tag Manager site. And you can set up a simple blocking rule so your tag doesn't
get by fired when somebody with a certain IP address
enters the site. And one more approach which could also be implemented via
Google Tag Manager is the custom variable approach or custom dimensions.
And they're called nowadays in Universal analytics you can send out a custom
dimension to a user who's visiting the site. For example on a specific login
page like on our demo shop, here we have the custom signup page log out which
everybody has to go through who is administrator of this user. So we
can identify on this page users that belong to the organization set a cookie
or a custom dimension, send it over to Google Analytics and then set up a rule
within the processing system to filter all these people out that have this
custom variable installed. And it's all pretty much explained in this blog post
that I will link up in the resource section. So overall I can just encourage
you to look at the different approaches out there what fits best to the company,
to your company but also to the clients, organization and send over instructions
to the client on how to install it. And make sure that your tracking is not
polluted by your own traffic data.