custom event trigger in google tag manager

女生的网名这么多〃 提交于 2020-01-01 14:47:47

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/31427762/custom-event-trigger-in-google-tag-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!