Google标签管理器中的自定义事件触发器 [英] custom event trigger in google tag manager

查看:508
本文介绍了Google标签管理器中的自定义事件触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我创建一个自定义触发器事件时,它都不会被触发。任何人都可以请可能是什么原因。我创建了'gacustomevent'自定义触发器并将其命名为'gaevent',但事件并未被解雇。我想使用dataLayer中的事件来捕获值。关于如何解决问题的任何建议

解决方案

从你的问题来看,你是如何设置它的有点不清楚。它应该是这样的:

  dataLayer.push({
'event':'myEvent'
})

(假定dataLayer已经初始化)。

在GTM中,您转到变量部分。在具有预定义变量的框中,点击事件前面的复选框。现在您已准备好在触发器中使用自定义事件。



转到触发器,选择新建 - >自定义事件。在事件名称框中输入myEvent(根据我的示例,用您自己的值替换)。



自定义事件仅在存在键/值在dataLayer中,键是event(这是GTM中的一个'保留字')。事件名称始终是该键的值。


Every time i create a custom trigger event it doesn't get fire. Can anybody please what may be the reason. I have created 'gacustomevent'custom triggerand have name it 'gaevent' but the event is not getting fired. Iwant to use the event in the dataLayer to capture the value. Any advice on how to get issue resolve

解决方案

It's a bit unclear from your question how you set this up. It should look like this:

dataLayer.push({
   'event':'myEvent'
})

(this assumes that the dataLayer is already initialized).

In GTM you go to the "variables" section. In the boxes with the predefined variables you hit the checkbox in front of "event". Now you're ready to use your custom event in a trigger.

Go to "trigger", select new -> custom event. In the event name box you enter "myEvent" (as per my example, substitute with your own value).

The custom event only works when there is a key/value pair in the dataLayer where the key is "event" (that's kind of a 'reserved word' in GTM). The event name is always the value for that key.

这篇关于Google标签管理器中的自定义事件触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆