Mark Handy
Mark Handy

Reputation: 1256

Google analytics filter RegEXp assistance

I have a filter that only shows me data with /documents/ in the URL. I need to modify the filter so i can get /documents/ and /getattachment/.

For the Filter Pattern could i use: "/documents/|/getattachment/", assuming the pipe is an OR?

Upvotes: 1

Views: 38

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 627468

When you have repeating patterns, you may consider shortening the final pattern.

I'd recommend using a grouping construct with alternation:

/(documents|getattachment)/

Now, the pattern will mean:

  • / - a slash
  • (documents|getattachment) - either one word or the other
  • / - a slash

Upvotes: 1

Related Questions