如何从GA过滤出二级和三级子域?

时间:2021-08-27 14:17:49

First off this is primarily to group webmail sources, as these are the largest offender of the many split up entries I get in GA

首先,这主要是对网络邮件来源进行分组,因为这些是我在GA中获得的许多分割条目中最大的攻击者

I want to start merging traffic sources that use two or three subdomains such as us-mg205.mail.yahoo.com or us.mg5.mail.yahoo.com

我想开始合并使用两个或三个子域的流量来源,例如us-mg205.mail.yahoo.com或us.mg5.mail.yahoo.com

Would like all of these to be grouped under mail.yahoo.com in this case

在这种情况下,希望所有这些都归入mail.yahoo.com

Edit: Based on @Crayon Violent's caveat I checked into my traffic records and I found that approximately 0.0007% of visits in the last month would be impacted by the country code effect (and not also be obviously webmail)

编辑:基于@Crayon Violent的警告我检查了我的流量记录,我发现上个月大约0.0007%的访问量会受到国家/地区代码效果的影响(并且显然也不是网络邮件)

I suppose one could also look for the word "mail" to match as a condition in the regex... I'll leave that for another question (or it can be "bonus")

我想也可以找一个“邮件”这个词作为正则表达式中的一个条件......我会把它留给另一个问题(或者它可以是“奖金”)

In short, really this is more of a GA profile filter setup question than a regex question;

简而言之,这真的是一个GA配置文件过滤器设置问题而不是正则表达式问题;

I'm happy with filtering using the number of dots in a domain only at this point using a pattern such as ([a-z0-9]*\.)*[a-z0-9]+\.[a-z0-9]+\.[a-z0-9]+\.[a-z0-9]+

我很高兴使用像([a-z0-9] * \。)* [a-z0-9] + \等模式在此时使用域中的点数进行过滤。[a-z0 -9] + \ [A-Z0-9] + \ [A-Z0-9] +

I'm just not sure how to set up the appropriate advanced profile filter in Google Analytics to make that work

我只是不确定如何在Google Analytics中设置适当的高级配置文件过滤器来实现这一目标

1 个解决方案

#1


1  

Filter type: Custom Filter > Search and Replace

过滤器类型:自定义过滤器>搜索和替换

Filter Field: Referral

过滤字段:推荐

Search String: ^https?://[^/?#]*\.?mail\.yahoo\.com([/?#].*)?

搜索字符串:^ https?:// [^ /?#] * \。?mail \ .yahoo \ .com([/?#]。*)?

Replace String: https://mail.yahoo.com\1

替换字符串:https://mail.yahoo.com \ 1

Case Sensitive: No

区分大小写:不

note that filters do not get applied to historical data.

请注意,过滤器不会应用于历史数据。

#1


1  

Filter type: Custom Filter > Search and Replace

过滤器类型:自定义过滤器>搜索和替换

Filter Field: Referral

过滤字段:推荐

Search String: ^https?://[^/?#]*\.?mail\.yahoo\.com([/?#].*)?

搜索字符串:^ https?:// [^ /?#] * \。?mail \ .yahoo \ .com([/?#]。*)?

Replace String: https://mail.yahoo.com\1

替换字符串:https://mail.yahoo.com \ 1

Case Sensitive: No

区分大小写:不

note that filters do not get applied to historical data.

请注意,过滤器不会应用于历史数据。