在Google Analytics报告中删除尾部斜杠

时间:2021-06-19 15:16:30

In Google Analytics, field Site Content report, I always receive two data about one link, one with slash and one non Like this:

在Google Analytics(分析)字段“网站内容”报告中,我始终会收到两个关于一个链接的数据,一个包含斜杠,另一个不包含此链接:

/post-one.html
/post-one.html/

I want to receive only data of (/post-one.html), then I create a Search and Replace filter:

我想只收到(/post-one.html)的数据,然后我创建一个搜索和替换过滤器:

Search string: \.html/$
Replace string: \.html$

But it doesn't work. How can I do it?

但它不起作用。我该怎么做?

3 个解决方案

#1


3  

Search string: \/$

搜索字符串:\ / $

Replace string: empty string

替换字符串:空字符串

#2


2  

You've got an extra * in there. Remove it.
You also need to remove the regex Kung fu from the replace string:

你有一个额外的*在那里。去掉它。您还需要从替换字符串中删除正则表达式功夫:

Search string: \.html/$
Replace string: .html

#3


1  

Based on some of the other comments and some experimentation, I realized that the Google help text actually implies that forward slashes in the Search field don't need to be escaped (so it's only quasi-regex):

基于其他一些评论和一些实验,我意识到Google帮助文本实际上暗示搜索字段中的正斜杠不需要转义(因此它只是准正则表达式):

A common use case for the Search and Replace filter is to turn multiple URLs into one. For example, to merge 'example.com/article/CA/planning+your+trip.html' and 'example.com/article/NY/exploring+the+country.html' so that your reports for the profiles for which you will apply this filter will show 'example.com/article/', please follow these steps:

“搜索和替换”过滤器的常见用例是将多个URL转换为一个。例如,要合并'example.com/article/CA/planning+your+trip.html'和'example.com/article/NY/exploring+the+country.html',以便为您的配置文件生成报告将应用此过滤器将显示'example.com/article/',请按照以下步骤操作:

Search String: example\.com/article/.*
Replace String: example\.com/article/

So I was able to create a Search/Replace Filter with the following:

所以我能够使用以下内容创建一个搜索/替换过滤器:

Search String: [^^]/$
Replace String: [blank]

And it appears to be working.

它看起来很有效。

#1


3  

Search string: \/$

搜索字符串:\ / $

Replace string: empty string

替换字符串:空字符串

#2


2  

You've got an extra * in there. Remove it.
You also need to remove the regex Kung fu from the replace string:

你有一个额外的*在那里。去掉它。您还需要从替换字符串中删除正则表达式功夫:

Search string: \.html/$
Replace string: .html

#3


1  

Based on some of the other comments and some experimentation, I realized that the Google help text actually implies that forward slashes in the Search field don't need to be escaped (so it's only quasi-regex):

基于其他一些评论和一些实验,我意识到Google帮助文本实际上暗示搜索字段中的正斜杠不需要转义(因此它只是准正则表达式):

A common use case for the Search and Replace filter is to turn multiple URLs into one. For example, to merge 'example.com/article/CA/planning+your+trip.html' and 'example.com/article/NY/exploring+the+country.html' so that your reports for the profiles for which you will apply this filter will show 'example.com/article/', please follow these steps:

“搜索和替换”过滤器的常见用例是将多个URL转换为一个。例如,要合并'example.com/article/CA/planning+your+trip.html'和'example.com/article/NY/exploring+the+country.html',以便为您的配置文件生成报告将应用此过滤器将显示'example.com/article/',请按照以下步骤操作:

Search String: example\.com/article/.*
Replace String: example\.com/article/

So I was able to create a Search/Replace Filter with the following:

所以我能够使用以下内容创建一个搜索/替换过滤器:

Search String: [^^]/$
Replace String: [blank]

And it appears to be working.

它看起来很有效。