首页 > 解决方案 > 如何在 nuxt.js 应用中使用 Google Adwords(和 Google Tag Manager/Analytics)

问题描述

我有一个 nuxt 应用程序,它使用了 nuxt 社区模块gtm-modulehttps ://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 社区模块?

非常感谢您的帮助。

干杯

标签: javascriptvue.jsnuxt.jsgoogle-tag-managergoogle-ads-api

解决方案


试试@nuxtjs/google-tag模块,因为它看起来有更多选择。https://github.com/nuxt-community/google-gtag


推荐阅读