How do I fire a tag in GTM when a value appears in my data layer?

百般思念 提交于 2019-12-11 11:57:47

问题


My website loads values into my data layer after the website loads. I'd like to fire tags when certain values appear in my data layer, and incorporate my data layer items into the tag (for example, an order id).

How can I achieve this?

Thanks!


回答1:


I assume you are doing a "push" to the dataLayer. Push a variable with the key "event" along with your orderid:

dataLayer.push({
'orderid' : '12345',
'event' : 'myEvent'
});

Then create a trigger type custom event where "event name equals myEvent' and use this to trigger your tag:



来源:https://stackoverflow.com/questions/30360805/how-do-i-fire-a-tag-in-gtm-when-a-value-appears-in-my-data-layer

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