I am setting up a conversion funnel in Google Analytics and want to capture all product collection pages for my Shopify store. To do this, I want to match everything with this pattern: ^/collections/.* but I also need to exclude everything with this pattern:
^/collections/.*/products/.*
The reason being that collection(product category) pages follow this structure: /collections/[collection-name]
E.g.,
- /collections/shoes
- /collections/tshirts
- /collections/hats etc
Product pages follow this structure: /collections/[collection-name]/products/[product-name]
E.g.,
- /collections/shoes/products/pink-reeboks
- /collections/tshirts/products/plain-white-tee
So I want to capture just the collection pages but not the product pages.
I have already identified a negative lookahead as the ideal way to do this. However, Google Analytics does not allow negative lookaheads, so I need another way to do this. Any help would be greatly appreciated!
Thanks in advance.
^/collections/collection-\d$
– Blexy