在Google Analytics中使用过滤器将两个引荐链接合并为一个

时间:2022-07-15 15:18:32

I have two referral urls that come from an email campaign and I'd like to combine them under referrals. The links are:

我有两个来自电子邮件广告系列的推介网址,我想将它们合并到推介下。链接是:

links.ssa.gov
links.govdelivery.com

So I set a search and replace filter with the following regex. The search string is:

所以我用以下正则表达式设置搜索和替换过滤器。搜索字符串是:

.*links\.ssa\.gov.*|.*links\.govdelivery\.com.*

and I'd like to replace them with the replace string 'govdelivery_emails'

我想用替换字符串'govdelivery_emails'替换它们

The two referral links are still showing up though. Is my regex done correctly?

尽管如此,两个推荐链接仍在出现。我的正则表达式是否正确完成?

1 个解决方案

#1


0  

Generally speaking...anytime regex is needed in a filter, an Advanced filter does a better job of producing the desired result than a S&R filter. There are exceptions, of course, but I will not go into specifics here.

一般来说......在过滤器中需要正则表达式时,高级过滤器比S&R过滤器更好地产生所需的结果。当然也有例外,但我不会在这里详细说明。

Here are the Advanced filter settings I would use for this scenario:

以下是我将用于此方案的高级过滤器设置:

1) Field A -> Extract A

1)字段A - >提取A

Field: Campaign Source

字段:广告系列来源

Match Pattern: (links.(ssa.gov|govdelivery.com))$

比赛模式:(链接。(ssa.gov | govdelivery.com))$

2) Field B -> Extract B

2)字段B - >提取B

leave empty

3) Output To -> Constructor

3)输出到 - >构造函数

Field: Campaign Source

字段:广告系列来源

Output Pattern: govdelivery_emails

输出模式:govdelivery_emails

Field A Required: yes

字段A要求:是的

Override Output Field: yes

覆盖输出字段:是的

These filter settings should work for you.

这些过滤器设置应该适合您。

#1


0  

Generally speaking...anytime regex is needed in a filter, an Advanced filter does a better job of producing the desired result than a S&R filter. There are exceptions, of course, but I will not go into specifics here.

一般来说......在过滤器中需要正则表达式时,高级过滤器比S&R过滤器更好地产生所需的结果。当然也有例外,但我不会在这里详细说明。

Here are the Advanced filter settings I would use for this scenario:

以下是我将用于此方案的高级过滤器设置:

1) Field A -> Extract A

1)字段A - >提取A

Field: Campaign Source

字段:广告系列来源

Match Pattern: (links.(ssa.gov|govdelivery.com))$

比赛模式:(链接。(ssa.gov | govdelivery.com))$

2) Field B -> Extract B

2)字段B - >提取B

leave empty

3) Output To -> Constructor

3)输出到 - >构造函数

Field: Campaign Source

字段:广告系列来源

Output Pattern: govdelivery_emails

输出模式:govdelivery_emails

Field A Required: yes

字段A要求:是的

Override Output Field: yes

覆盖输出字段:是的

These filter settings should work for you.

这些过滤器设置应该适合您。