Follow Us

Google Analytics GA 的事件追踪代码分析

事件追踪的基本代码段是:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

如果你要追踪PDF 下载,例子就是以下这样

a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push([‘_trackEvent’, ‘whitepaper’, ‘download’, ‘SEO is great’, 5, true]);” target=”_blank”>SEO Is Great Whitepapervalue-time-on-site

在GA中事件追踪在哪里,让我们快速的过一下:

finding-event-reports

一般的事件追踪有:

出站链接点击
内部链接点击
注册,登录,提交订阅
下载
视频播放
社交分享
表格填写
下拉动作

最后两个是比较难的。

1. 出站链接的代码段是:

a href=”https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide” onClick=”_gaq.push([‘_trackEvent’, ‘resource’, ‘outbound link’, ‘https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide’, 1, true]);” target=”_blank”>Google’s Guide to Event Tracking2.站内广告图片的代码段是:

a href=”#banner1″ onClick=”_gaq.push([‘_trackEvent’, ‘banner’, ‘internal link’, ‘banner 1’]);”>13. 注册代码段:

a href=”http://dianshangtalk.com/wp-content/uploads/2014/06/sign-up-box.jpg”>sign-up-box

4.下载代码段:

a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push([‘_trackEvent’, ‘whitepaper’, ‘download’, ‘SEO is great’, 5, true]);” target=”_blank”>SEO Is Great Whitepaper5. 社交追踪

用于追踪推特
a href=”https://twitter.com/koozai_anna” onClick=”_gaq.push([‘_trackEvent’, ‘social media’, ‘twitter’, ‘my_Anna’]);” target=”_blank”>Anna on Twitter
用于追踪facebook
a href=”https://en-gb.facebook.com/me” onClick=”_gaq.push([‘_trackEvent’, ‘social media’, ‘facebook’, ‘anna on Facebook’]);” target=”_blank”>anna on Facebook

ѩ Űѩ ѩѰٻ ѩѳ ѩƷ ѩѹ ѩ ѩ ŷѩ ѩר ѩô ŰѩѼ۸ ѩ ħѩ ȫѩ ѩ Űѩ ѩ ѩ ѩѿ칺 ŷҶѩ Űѩ