简体   繁体   English

链接中的Google Blogger / Blogspot onclick事件不会传递给Google Analytics(分析)

[英]Google Blogger/Blogspot onclick event in link will not pass to Google Analytics

I have the following snippet of code in a post in blogger/blogspot but I will not see this event in Google Analytics in Real Time. 我在Blogger / blogspot中的帖子中包含以下代码段,但我不会在Google Analytics(分析)中实时看到此事件。

<a href="http://example.com" target="_blank" onclick="ga( 'send', 'event', {'Ebook', 'Download', 'ebook.pdf'});"><button>Download</button></a>

FYI the head in the blog includes the following: 仅供参考,博客中的负责人包括以下内容:

<script type="text/javascript">
        (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', 'XXX', 'auto', 'blogger');
        ga('blogger.send', 'pageview');
      </script>

(id removed on purpose) (有意删除的ID)

Does blogger block such info from flowing to GA? 博客是否会阻止此类信息流向GA?

Is there anything that can be done? 有什么可以做的吗?

Thank you 谢谢

It seems to be using a custom tracker name, more about it here: https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers 它似乎使用的是自定义跟踪器名称,​​请在以下网址中详细了解: https : //developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers

You can try the following: 您可以尝试以下方法:

onclick="ga( 'blogger.send', 'event', {'Ebook', 'Download', 'ebook.pdf'});"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM