javascript - 如何在 nuxt.js 应用中使用 Google Adwords(和 Google Tag Manager/Analytics)
问题描述
我有一个 nuxt 应用程序,它使用了 nuxt 社区模块gtm-module
:
https ://github.com/nuxt-community/gtm-module/它负责谷歌标签管理器的东西。
我现在有需要将 Adwords 添加到组合中的情况。根据此来源(https://support.google.com/google-ads/answer/7548399?hl=en#adapt_gtagAW-CONVERSION_ID
),只需向我的全局站点标签添加另一个配置 ID 应该很容易。
不幸的是gtm-module
,它既没有描述如何处理 Adwords,也没有描述如何向网站标签添加自定义内容。
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"> </script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
gtag('config','AW-CONVERSION_ID'); // THIS IS WHAT I NEED ADDITIONALLY
</script>
有谁知道我如何可以在这里完成描述的解决方案(https://support.google.com/google-ads/answer/7548399?hl=en#adapt_gtag)但使用 nuxt gtm 社区模块?
非常感谢您的帮助。
干杯
解决方案
试试@nuxtjs/google-tag模块,因为它看起来有更多选择。https://github.com/nuxt-community/google-gtag
推荐阅读
- c - 将大数作为单独的数字存储在数组中
- php - 从数据库搜索时如何避免空白的第一个结果
- r - 如何转义 RODBC 连接字符串密码中的特殊字符
- r - 无法在 SQLite 的列中保存多个值
- c++ - 实现自定义异步任务类型并等待
- reactjs - 如何自定义 Highcharts.js 中的条形宽度和条形间距
- javascript - WebAudio API:如何在 AudioWorkletProcessor 中访问时间/采样率?
- chart.js - 无法在图表 js 注释插件中旋转标签
- javascript - 节点js中的击键输入键发送
- c# - 错误:“System.InvalidOperationException:无法找到所需的服务。”如何解决?