Matt
Matt

Reputation: 75

Rewriting certain URL's using Regex in Google Analytics Filters

How do I rewrite

/product-category-xyz/prefix-product-name-and-model

into

/prefix/product-category-xyz/product-name-and-model

for easier reporting in Content Drilldown report?

Advanced filter function in GA

Upvotes: 0

Views: 704

Answers (2)

nyuen
nyuen

Reputation: 8907

You can try this out:

Extract A: "Request URI"; ^(\/.*)(\/.*)-(.*)
Extract B: {leave blank}
Constructor: $A2$A1/$A3

Hope this helps.

Upvotes: 2

Sivasakthi Jayaraman
Sivasakthi Jayaraman

Reputation: 4724

one possible solution..

Regex:

(.*\/)(.*?)-(.*)

Substitution:
/\2\1\3

Demo:
http://regex101.com/r/zD6iJ3/1

Upvotes: 2

Related Questions