是否接受基于Cookie触发GTM事件的方法 [英] How to Trigger a GTM event based on Cookie is accepted or not

查看:117
本文介绍了是否接受基于Cookie触发GTM事件的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GTM中有一个脚本(作为tag),仅当用户接受特定的cookie时才需要触发.问题是-我通过GTM添加了属于特定Cookie类别的脚本.当用户只想接受分析(按预期GTM加载)时,我通过GTM添加的属于另一个Cookie类别(不是analytics)的脚本也会触发(理想情况下,不应仅接受用户接受分析) .仅当接受cookie时,才有办法触发GTM事件.

There is a piece of script in GTM ( as tag ) that needs to trigger only when user accepts a particular cookie. Problem is - I have added a script belonging to the particular cookie category via GTM. When a user wants to accept only analytics ( GTM loads as expected ), the script I have added via GTM which belongs to another cookie category ( not analytics ) also fires ( Ideally it shouldn't cos only analytics is accepted by the user ) . Is there a way to trigger GTM event only when cookie is accepted.

推荐答案

如果我理解正确,则您仅在接受功能性cookie并且功能cookie为是"的情况下才加载功能脚本.

If I understood correctly, you're looking to load the functional script ONLY if they accept AND functional cookie is 'yes'

在GTM中,有变量"可以跟踪第一方Cookie.因此,在您的情况下,您将希望:

In GTM, there are "Variables" that can keep track of 1st party cookies. So in y our case you would want to:

创建一个变量以跟踪功能cookie值

基于单击接受"按钮创建触发器.并且基于该值是是"只是有条件的. (您需要预先创建自定义功能脚本标签)

将触发器添加到功能标签

这篇关于是否接受基于Cookie触发GTM事件的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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