来自 Google Analytics 的 _trackEvent() 不起作用? [英] _trackEvent() from Google Analytics not working?

查看:24
本文介绍了来自 Google Analytics 的 _trackEvent() 不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上设置了 Google Analytics,它肯定会记录页面浏览量.但是我添加了一些代码来调用 pageTracker._trackEvent(category, action, label, value),它没有记录这些点击或在报告中显示它们.

I have Google Analytics setup on my site, and it is definitely recording page views. But I have added some code to call pageTracker._trackEvent(category, action, label, value), and it is not recording those hits or showing them in the reports.

顺便说一句,是的,我已经等了 24 小时以上,看看这些点击是否在报告中.

BTW, yes, I have waited for over 24hrs to see if the hits are in the reports.

我使用了标准的 Google 脚本包含以及 此处提到的技术.似乎都没有帮助 _trackEvent() 问题.

I have used the standard Google script include as well as the technique mentioned here. Neither one seems to help the _trackEvent() problem.

谁能给我一些关于如何追踪问题所在的建议?如果您让我知道哪些部分很重要,我很乐意发布代码示例.

Can anyone give me some advice on how to track down what's going wrong? I'd be happy to post code examples if you let me know what parts are important.

谢谢.

推荐答案

问题是我放在最后一个参数中的值,即value"参数.

The problem was the values that I was putting in the final argument, the "value" parameter.

pageTracker._trackEvent(category, action, label, value)

我将非整数字符串传递给value"参数:

I was passing non-integer strings to the "value" parameter:

pageTracker._trackEvent("UserAction", "ShowHelp", "Page", "http://mysite/UrlGoesHere");

但文档说它需要是一个整数值.

but the docs say it needs to be an integer value.

pageTracker._trackEvent("UserAction", "ShowHelp", "http://mysite/UrlGoesHere",  1);

我提出了问题 在此处的 Google 帮助论坛上.

I posed the question on Google Help Forums here.

这里是事件跟踪文档的链接

感谢 Török 的帮助

Thanks for the help Török

这篇关于来自 Google Analytics 的 _trackEvent() 不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆