使用 GTM 实现事件跟踪
Implementing Event Tracking with GTM
我已使用默认设置将 Universal Analytics 添加到 Google 跟踪代码管理器。目前我在用户注册页面中有以下代码:
_gaq.push(['_trackEvent', 'Account Events', 'Create Account', 'Create new account ']);
如何将其转换为 'DataLayer.push'? GTM 端是否需要任何配置更改?请告诉我。
谢谢。
您可以在成功提交帐户创建表单后执行类似的操作:
dataLayer.push({
'event': 'account created',
'cat': 'Account Events',
'act': 'Create Account',
'lab': 'Create new account'
})
然后在 GTM 中,您需要使用类别、操作和标签的相应宏创建事件标签。
事件代码将根据此规则触发:
{{event}} equals "account created"
我已使用默认设置将 Universal Analytics 添加到 Google 跟踪代码管理器。目前我在用户注册页面中有以下代码:
_gaq.push(['_trackEvent', 'Account Events', 'Create Account', 'Create new account ']);
如何将其转换为 'DataLayer.push'? GTM 端是否需要任何配置更改?请告诉我。
谢谢。
您可以在成功提交帐户创建表单后执行类似的操作:
dataLayer.push({
'event': 'account created',
'cat': 'Account Events',
'act': 'Create Account',
'lab': 'Create new account'
})
然后在 GTM 中,您需要使用类别、操作和标签的相应宏创建事件标签。
事件代码将根据此规则触发:
{{event}} equals "account created"