使用Google Universal Analytics进行事件跟踪

时间:2021-12-06 13:36:18

I have seen other topics on this issue. I have tried to search and cant figure it out so i need help.

我在这个问题上看过其他主题。我试图搜索,无法弄清楚,所以我需要帮助。

My tracking code is...

我的跟踪代码是......

<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-41800392-1', 'monsourlawfirm.org');
  ga('send', 'pageview');

</script>

and the event is a click to call on the site. the code for that is...

并且该事件是在网站上点击呼叫。代码是......

<a href="tel:8882594979" onClick="ga('send', 'mobile', 'click to call', '888-259-4979');">1 (888) 259-4979</a>

I have waited 24hrs and do not see anything recording.

我等了24小时,没有看到任何录音。

1 个解决方案

#1


23  

You're missing the hit type parameter. Check out Universal Analytics documentation. Your event should be:

你错过了命中类型参数。查看Universal Analytics文档。你的活动应该是:

<a href="tel:8882594979" onClick="ga('send', 'event', 'mobile', 'click to call', '888-259-4979');">1 (888) 259-4979</a>

You can verify that the event is firing using a tool to monitor http requests or by logging into your GA account and looking at real-time reports.

您可以使用工具来验证事件是否正在触发,以监控http请求或登录您的GA帐户并查看实时报告。

#1


23  

You're missing the hit type parameter. Check out Universal Analytics documentation. Your event should be:

你错过了命中类型参数。查看Universal Analytics文档。你的活动应该是:

<a href="tel:8882594979" onClick="ga('send', 'event', 'mobile', 'click to call', '888-259-4979');">1 (888) 259-4979</a>

You can verify that the event is firing using a tool to monitor http requests or by logging into your GA account and looking at real-time reports.

您可以使用工具来验证事件是否正在触发,以监控http请求或登录您的GA帐户并查看实时报告。