[英]How prevent Google Tagmanager from changing javascript values?
这是Google Tagmanager中的自定义HTML标签:
<script>
_dAutomationGtmAddTimer("mysite.com", "bh2Ry58My0NWFw==", {"cmp1":
visitorContactInfo[0], "cmp2": visitorContactInfo[1], "cart_data":[{"amount":orderFormProducts[quantity],"id":orderFormProducts[sku],"image":"","link":"URL produto","name":orderFormProducts[name],"description":"","unitary_value":orderFormProducts[sellingPrice]}]})
</script>
当第二个参数"bh2Ry58My0NWFw=="
由Tagmanger注入DOM时,更改为"bh2Ry58My0NWFw\\x3d\\x3d"
,用\\x3d\\x3d
替换==
。
请知道如何防止此值更改?
试试这个方法:
首先 ,创建一个常量变量:
bh2Ry58My0NWFw==
然后 ,修改您的自定义HTML标记,使其看起来像
<script>
_dAutomationGtmAddTimer("mysite.com", "{{API key}}", {"cmp1":
visitorContactInfo[0], "cmp2": visitorContactInfo[1], "cart_data":[{"amount":orderFormProducts[quantity],"id":orderFormProducts[sku],"image":"","link":"URL produto","name":orderFormProducts[name],"description":"","unitary_value":orderFormProducts[sellingPrice]}]})
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.