I would like to filter all traffic from IE7 to our website in Google Analytics.

Because of some back-end controls we use for a desktop app, we have an unusually large amount from that browser, even though the technology has been deprecated. This is obviously skewing the data with "fake" traffic.

In GA, I get stuck on "Filter Pattern" as per screenshot.

What do I do from here?

enter image description here

1 Answer 1


An example IE 7 user agent string is (source):

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3)

You need to do is filter on the MSIE 7 against the user agent.

Unfortunately, Google Analytics does not allow you to filter by user agent by default. Google Analytics breaks the user agent down into browser name and browser version. However, you cannot create a filter based on two fields.

You will need to pass user agent into Google Analytics as a custom variable. This site has instructions for doing so:

  1. Create a custom dimension in Google Analytics named "User Agent" (note its index)
  2. Use Google Tag Manager to create the custom variable on your site as JavaScript Variable and navigator.userAgent. Then put that into a custom dimension of GA using the index you noted earlier and {{User Agent}} If you are not using GTM, you can modify your GA snippet with some JS as shown here:

    ga('send', '', {
      'dimension1':  navigator.userAgent

    You will need to change the number after "dimension" to match the index you noted earlier.

  3. Wait a couple days for some data to populate before trying to create your filter so that you can test it.

Google has an example of creating a filter for IP addresses here. Based on that example the filters are regular expressions that can match a portion of the field. (You shouldn't have to use .* at the beginning and end of the regular expression to ensure that it matches the entire field.)

So you should just be able to make your filter pattern:


If you ever wanted to expand that to other IE versions you could do so with something like:

MSIE [5678]


MSIE (7|8|9|10)
  • 1
    Hi Stephen, sorry I am still learning here... I tried MSIE 7 and MSIE 7.0 in the field but when I clicked Filter Verification it returned: This filter would not have changed your data. Either the filter configuration is incorrect, or the set of sampled data is too small. I don't think he sample is too small. I guess I can try it and see in a few days if it has worked.
    – walbuc
    Commented Feb 18, 2016 at 11:37
  • I forgot to say to change the drop down for "Filter Field" to "User Agent". I've edited the answer. Commented Feb 18, 2016 at 11:46
  • There is no "User Agent" in the drop down - is it under another name?
    – walbuc
    Commented Feb 19, 2016 at 6:00
  • 1
    I see that it is not available. I've found instructions for creating it as a custom dimension and included them into this answer. Commented Feb 19, 2016 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.