1

I need to build a Google Analytics filter that includes all traffic from a selection of subdirectories, in my case all that start with customer and company.

You can see my configuration below, but the basic pattern is this:

/customer|/company

enter image description here

According to the Google help file one should be able to pipe together multiple patterns: https://support.google.com/analytics/answer/1034832?hl=en

But this clearly does not work. Any idea how to achive this?

Update: I've tried @nyuen suggestion, but getting zero visitors like this. Do I have to switch to a custom filter?

enter image description here

Solution:
Customer filter with include was the solution. enter image description here

migrated from webapps.stackexchange.com Dec 9 '16 at 1:10

This question came from our site for power users of web applications.

1

There are a couple of issues that I immediately see:

  1. Subdomain is not the same as subdirectory. A subdomain looks like company.domain.com or customer.domain.com. A subdirectory looks like www.domain.com/customer or www.domain.com/company.
  2. If you are talking about subdomains, then you should use a regex match on a hostname of (customer|company)\.domain\.com. If you are talking about subdirectories, then you should use a regex match on a page path of /(customer|company)/.*.

Note that you can't use the begins with match type with a regular expression as you have in your example.

  • Thanks! I'm looking about subdirectory. Sorry for this. I fixed the question. But it's still not working. – Remy Dec 12 '16 at 10:26
  • Sorry I'm not at my computer right now and I can't check, but try a Custom filter with your regex pattern. – nyuen Dec 12 '16 at 14:37
  • 1
    Also note that to page paths (and subdirectories) are referred to, in custom filters, by "Request URI". – nyuen Dec 12 '16 at 17:57
  • Request URI only contains the subdirectory? Not the whole URL? I'm still facing the issue that subdirectories like e.g. "/en/company/jobs" are also caught. – Remy Dec 13 '16 at 8:25
  • I saw your Solution above in your post, is everything OK now? – nyuen Dec 13 '16 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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