简体   繁体   中英

Regex to remove a portion of the URL in Google Analytics

Is there a way to write a regex to remove a portion of a URL, then aggregate the data in a Google Analytics view? We use country and language in our site URLs so I'm looking for an easier way to aggregate the data for a page rather than all country-language versions of the page.

For example, some of the URLs might look like:

/US/en/painting/products/brushes/default.htm

/FR/fr/painting/products/brushes/default.htm

/PT/br/painting/products/brushes/default.htm

Is there a way to strip out the /country/language and capture the subsequent result in a Google Analytics view?

Once the data is acquired you cannot modify it. You can instead insert a filter in the view for rewriting the URL, in this case you can apply a regex for the strip of the unwanted part of the URL (note: you will lose this part, so if you need it you will not have it).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM