google-analytics - 在 DPS 中集成 GA

标签 google-analytics adobe-dps

我没有成功将 Google Analytics 集成到 Adob​​e Digital Publishing Suite 中。

我所做的是创建一个包含 ga 脚本的虚拟 html 文件:

<!DOCTYPE html>
<html>
<body>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none' });
  ga('send', 'pageview');

</script>
</body>
</html>

如果我在本地主机上尝试,我可以在实时谷歌分析上看到该页面,但如果在 DPS 上创建一个 html 对象,将其导出,我可以看到我的白页,但看不到 GA 中的实时统计信息。

那是成功的人吗?怎么做?

最佳答案

您是否将 html 嵌入到应用程序/杂志中?
如果是这种情况,webview 可能会添加 文件:在 GA javascript 文件的 url 之前(因此无法找到)。您可以手动添加 https:以防止这种情况。

你的代码应该是这样的:

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none' });
  ga('send', 'pageview');

关于google-analytics - 在 DPS 中集成 GA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19274394/

相关文章:

javascript - 尝试将 Google Analytics 添加到 Chrome 扩展

javascript - 从Facebook登录重定向后,在Adobe DPS叠加中进行 meteor 渲染

api - 获取 Adob​​e DPS 对开列表

ios - Adobe DPS Webview 缓存问题

selenium - 如何使用 Selenium WebDriver 捕获网络流量并查找 google Analytics 调用?

indexing - 谷歌分析 : Can I use custom dimension name instead of index when sending data?

google-analytics - 如何获取未设置值的维度(自定义变量)的结果?

javascript - 谷歌分析 : how to track outbound links that open in a new tab?