admin管理员组文章数量:1194924
I am trying to add custom event tracking to a link on a site I built. For some reason it does not seem to be working. The code I have is:
onClick="_gaq.push(['_trackEvent', 'SOU Links', 'Click', 'Top edu banner']);"
The site URL is /. The link with the event tracking is the "Sign Up Now" link at the top of the page. Any ideas?
I am trying to add custom event tracking to a link on a site I built. For some reason it does not seem to be working. The code I have is:
onClick="_gaq.push(['_trackEvent', 'SOU Links', 'Click', 'Top edu banner']);"
The site URL is http://sou.wpengine.com/. The link with the event tracking is the "Sign Up Now" link at the top of the page. Any ideas?
Share Improve this question asked Sep 9, 2013 at 19:24 AndrewAndrew 1,1214 gold badges15 silver badges24 bronze badges 2- Please check that the for _trackEvent, the value parameter should be an integer. – Rahul Tripathi Commented Sep 9, 2013 at 19:28
- What do you mean? In Google's documentation (here: developers.google.com/analytics/devguides/collection/gajs/…) they do not use an integer. They have it like so: <a href="#" onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby\'s First Birthday']);">Play</a> – Andrew Commented Sep 9, 2013 at 19:32
4 Answers
Reset to default 13I had an issue with events not tracking (using Universal Analytics).
I installed the official Google Analytics Debugger from
https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna
And it showed me a warning message that event value was expecting an integer, but receiving an empty string. Once I cleared that up, the events showed up in the realtime tracker right away.
It appears you're using the advanced configuration setup described by google here. To track events, you'll want to use the event tracking methods described by google here.
Hope this helps.
Adding another helpful link: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
This will work for older tracking version: Tracking Basics (Asynchronous Syntax)
As bbone said, you are using the event tracking syntax for ga.js (Classic Analytics) and you have analytics.js (Universal Analytics) on your site.
If you want to track the "Sign Up Now" link, use this:
ga('send', 'event', 'SOU Links', 'Click', 'Top edu banner');
you should send also _gaq.push(['_setAccount', 'UA-XXXXXX-1']); before the tracking event and install for chrome this extension to debug https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna
it worked for us
本文标签: javascriptGoogle Analytics Custom Event Tracking Not WorkingStack Overflow
版权声明:本文标题:javascript - Google Analytics Custom Event Tracking Not Working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738481236a2089153.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论