0

please help me to nake regular expresion. I have two types of links:

1) collection page:https://www.rentuu.com/collections/bedroom

2) product page:https://www.rentuu.com/collections/bedroom/products/bean-bag

They have the same begining and I need to see in my report only collection pages and exclude product pages.

How can I change *collections/.* to make it?

1 Answers1

0

As far as I understand, your rule for such URLs would be to check URLs with "collections", but without "products".

There's a topic discussing regex for excluding string pattern. However, I think it's not supported in Google Analytics.

One approach would be two use two filters in your reports: one to include all pages with "collections", an other one to exclude pages with "products". You can of course bee more specic with the rules. E.g. enter image description here

If for any reason you must use only one filter, you could craft something like this, meaning: get all pages starting with /collections, having some other letters (collection name) after an other / character, which is then followed by URL parameters (?) or end of string ($), meaning no product names can come after.

^\/collections\/[a-z]+(\?|$)
kgrg
  • 1,605
  • 1
  • 12
  • 14