Google 过滤器的分析正则表达式

Google Analytics Regular Expressions for Filters

我试图阻止我们的一些网站通过垃圾邮件引荐访问收到的大量垃圾邮件,因此我创建了以下正则表达式:

.*(event-tracking|porn|hulfington|free-share-buttons|buttons-for-your-website|Get-Free-Traffic|darodar|best-seo-offer|buy-cheap-online|theguardlan|googlsucks).*

然后我进入 Analytics > Admin > Filters > +New Filter > Custom Filter > Exclude Referral > 然后添加了这个正则表达式。

虽然验证时,我收到:

This filter would not have changed your data. Either the filter configuration is incorrect, or the set of sampled data is too small.

这个正则表达式在 Google Analytics 中不起作用有什么原因吗?

Filter help中写着:

Limitations of filters

Filters require up to 24 hours before they are applied to your data.

Fields specified in a filter must exist in the hit and not be null in order for the filter to be applied to that hit. For example, if you are filtering on Hostname, but the hit does not contain that field (perhaps the hit was sent via the Measurement Protocol and that request did not contain the &dh parameter), then any filters acting on Hostname will be ignored and the hit will be processed as if there was no filter.

因此,要么等待 24 小时让过滤器生效(并且您的正则表达式将起作用,因为它是有效的),要么检查您是否在过滤主机名(在这种情况下,您的过滤器将不起作用) .

此外,您可以检查警告中所述的过滤器配置。 Here 您可以找到一些关于如何使用排除过滤器的很好的分步教程。

表达式是正确的,你甚至可以去掉 .* 我知道使用引用作为 过滤字段 听起来合乎逻辑,但你应该使用 Campaign Source 而不是,您的过滤和验证将起作用(过滤验证只是对您的数据进行抽样)

这是Googlehttps://support.google.com/analytics/answer/1034842?hl=en

的推荐

虽然这是阻止引荐来源垃圾邮件的常用方法,但最近 垃圾邮件发送者一直在通过直接访问和引荐进行攻击,您的过滤器将仅适用于引荐部分,并且您仍然会收到来自直接访问的垃圾邮件。这是一个演示:

https://webmasters.stackexchange.com/a/81193/49561

如果您希望摆脱幽灵垃圾邮件,无论它如何点击(引荐、关键字或直接),您应该使用有效的主机名过滤器。 Ghost Spam 使用假主机名或 "not set"。这是有关此解决方案的详细信息