admin管理员组文章数量:1335840
Hi I'm new to Google Tag Manager,
I am trying to add Google Adwords Conversion Pixel to our website, and google tells me I should add the following snippet.
gtag('event', 'conversion', {
'send_to': 'AW-1000000/XXXXXXXX',
'event_callback': callback
});
Since our website is already using gtm.js
,
can I convert the above snippet to the following to get the same effect?
dataLayer.push({ "event": "conversion",
"send_to": "AW-1000000/XXXXXXXX", "event_callback": undefined})
Hi I'm new to Google Tag Manager,
I am trying to add Google Adwords Conversion Pixel to our website, and google tells me I should add the following snippet.
gtag('event', 'conversion', {
'send_to': 'AW-1000000/XXXXXXXX',
'event_callback': callback
});
Since our website is already using gtm.js
,
can I convert the above snippet to the following to get the same effect?
dataLayer.push({ "event": "conversion",
"send_to": "AW-1000000/XXXXXXXX", "event_callback": undefined})
Share
Improve this question
edited Sep 17, 2020 at 10:36
yodabar
4,7993 gold badges35 silver badges39 bronze badges
asked Nov 30, 2017 at 20:34
dorachan2010dorachan2010
1,0913 gold badges14 silver badges21 bronze badges
2 Answers
Reset to default 5No. But you can create an Adwords conversion tag within GTM (there is a template for this, the part before the slash is the conversion id, the part after the slash the conversion label). If you want you can configure the tag via the dataLayer, but you'd still have to create a tag within GTM and apply a trigger to make this work.
Gtag.js is great for sites that don't use tag management systems. If you use GTM, then use GTM triggers and tag templates for adwords to acplish your measurement needs.
Gtag.js will be the library that replaces analytics.js, and thus replace the ga('send') type of measurement code. You have likely replaced that syntax with the GTM GA tag templates and triggers like "All Pages".
本文标签: javascriptAre gtagjs and gtmjs interchangeableStack Overflow
版权声明:本文标题:javascript - Are gtag.js and gtm.js interchangeable? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742386887a2465212.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论