谷歌分析灯箱问题
我正在尝试将自定义变量发送到谷歌分析,并在灯箱中返回值。据我所知,该值正在正确返回,即使不是,我也已经使用自定义变量的简单字符串进行了测试。奇怪的是,自定义变量似乎被推送到队列中,但是当我推送跟踪事件时,跟踪事件会触发,似乎没有发送自定义变量。
我几天来一直在寻找有类似问题的人,但找不到任何好的资源。有人可以帮忙吗?这是相关代码的最新版本。灯箱中没有其他分析调用。域名和帐户更改为 x 的:
<asp:HiddenField ID="ProfessionValue" runat="server" />
<script type="text/javascript">
var chosenProfCode = document.form1.ProfessionValue.value + '';
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XX-XXXXXXX']);
_gaq.push(['_setDomainName', '.xxxxxxxx']);
_gaq.push(['_setCustomVar', 1, 'Visitor Type', chosenProfCode, 1]);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
我还尝试将自定义变量包装在一个函数中,并随后进行“trackEvent”调用等。
请帮忙!
还发布到谷歌分析社区: http://www.google.com /support/forum/p/Google+Analytics/thread?tid=67a119f52ada0b07&hl=zh-CN
I am attempting to send a custom variable to google analytics with a returned value in a lightbox. As far as I can tell the value is returning appropriately, and even if it weren't I have tested with simple strings for the custom variable. Strangely the custom variable appears to be pushed to the queue but when I then push a track event, the track event fires, seemingly without sending the custom variable along.
I have been looking for days for someone who has had a seemingly similar issue and can not find any good resource. Could anyone please help? This is the latest version of relevant code. There are no other analytics calls in the lightbox. domain name and account changed to x's:
<asp:HiddenField ID="ProfessionValue" runat="server" />
<script type="text/javascript">
var chosenProfCode = document.form1.ProfessionValue.value + '';
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XX-XXXXXXX']);
_gaq.push(['_setDomainName', '.xxxxxxxx']);
_gaq.push(['_setCustomVar', 1, 'Visitor Type', chosenProfCode, 1]);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
I have also tried wrapping the custom var in a function with a subsequent "trackEvent" call, etc.
Please help!
Also posted to the google analytics community:
http://www.google.com/support/forum/p/Google+Analytics/thread?tid=67a119f52ada0b07&hl=en
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论