简体   繁体   English

正则表达式删除谷歌分析中的一部分 URL

[英]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?有没有办法编写正则表达式来删除 URL 的一部分,然后在 Google Analytics 视图中聚合数据? 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.我们在网站 URL 中使用国家/地区和语言,因此我正在寻找一种更简单的方法来聚合页面的数据,而不是页面的所有国家/地区语言版本。

For example, some of the URLs might look like:例如,某些 URL 可能如下所示:

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

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

/PT/br/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?有没有办法去掉 /country/language 并在 Google Analytics 视图中捕获后续结果?

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).您可以在视图中插入一个过滤器来重写 URL,在这种情况下,您可以为 URL 不需要的部分的条带应用正则表达式(注意:您将丢失这部分,因此如果您需要它,您将没有它)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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