0

我在使用 Google-Tag-Manager 时遇到了麻烦。

我在特定页面上有一个表单,我想跟踪成功提交的内容。

表单所在的 URL 有两种变体:

https://example.com/secure/billinginfo?prodCode=B
https://example.com/secure/billinginfo?prodCode=P

我有一个在所有页面上触发的表单提交侦听器标记。

我现在创建了一个新标签来使用表单监听器:

Universal Analytics;
Track Type: Event;
Firing Rules: {{event}} = gtm.formSubmit and {{url}} matches regex https://example.com/secure/billinginfo?prodCode+

所以我只是为 URL 的每个变体的最后两个字符添加了一个正则表达式“+”,它以“ =B”或“ =P”结尾。但是标签没有触发。

我也尝试过简单地使用{{url}} contains /secure/billinginfo?prodCode,但这也没有用。

当显示任一版本的 URL 时,设置规则以触发代码的最佳方法是什么?

4

1 回答 1

1

检查您的正则表达式:您没有逃避?.

secure/billinginfo\?prodCode=[B,P]

另外,尝试使用{{path}}宏而不是{{url}}宏。

于 2014-01-23T19:23:57.317 回答