使用 Google Analytics 跟踪 Ajax 形式的目标
感谢您花时间阅读我的问题。
我的网站上有一个 ajax 表单,我正在尝试跟踪注册情况。我已经阅读了多篇关于该主题的帖子,但无法使其发挥作用。
这是我的表单代码的副本: http://pastie.org/1916397 Google Analytics 中有我的目标配置的屏幕截图:https://i.sstatic.net/m2TX5。 png
我有注册,但 Google Analytics 似乎没有检测到它们! :(
我的代码上有 Google Analytics 标签:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX']);
_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>
提前谢谢您,
Thank you for taking the time to read my question.
I have an ajax form on my website and I'm trying to track the signups. I have read multiples post on SO on the subject but cant make it work.
This is a copy of the code of my form: http://pastie.org/1916397
And there is a screenshot of my goal config in Google Analytics: https://i.sstatic.net/m2TX5.png
I have signups, but Google Analytics dont seem to detect them ! :(
I have that Google Analytics tag on my code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX']);
_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>
Thank you by advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自您的粘贴:
除非您在用户点击表单时触发事件,否则问题是您的属性拼写错误。它应该是
onclick
,而不是onlick
。发生在我们最好的人身上:)
From your pastie:
Unless you're triggering an event when a user licks a form, the problem is that your attribute is misspelled. It should be
onclick
, notonlick
.Happens to the best of us :)