如何记录谷歌分析每一刻? [英] How to record every moment in google analytics?

查看:117
本文介绍了如何记录谷歌分析每一刻?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的技术载体来实现简单的谷歌分析所以,即通过观众浏览网页记录在谷歌分析。现在我的客户之一是要求记录一切发生在页面上,就像按一下按钮,指定和视频播放,停止,观看视频的用户的持续时间。我已经做了一些R&安培; d这一发现
事件跟踪 - 从谷歌的Web跟踪(ga.js)的
..但我不知道如何使用这个。
我也想知道,是此功能只对付费用户?或免费的用户也可以使用此选项。请帮我。

i have implemented simple Google Analytic so for in my technical carrier, i.e. pages viewed by audience are recorded in Google Analytic. now one of my client is asking to record everything happens on the page, like click on specify buttons and video play, stop, time duration of video user watched. I have did some R&D on this and found Event Tracking - Web Tracking (ga.js) from google.. but i am not sure how to use this. and I also want to know, is this feature is only for paid users? or free users can also use this option. Please help me.

推荐答案

在事件追踪GA是真棒并且完全免费。您可以跟踪它什么样的按钮,点击,YouTube视频,PDF格式下载,JS表单提交等等。

Event tracking in GA is awesome and totally free. You can track anything with it like buttons, clicks, youtube videos, pdf downloads, js form submissions ect ect.

下面是ga.js的(旧版本的GA)的基本布局:
_gaq.push(['_ trackEvent','分类','动作','选项标签,选项值,选择参加非互动'])

Here is the basic layout for ga.js (the older version of GA): _gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])

下面是分解和对各部分。

Here is the breakdown and what each part means.

'_ trackEvent - 这是一个JavaScript方法开出阵列

'_trackEvent' – This is a JavaScript method that starts out the array.

类别 - 要显示出来,用的东西广阔如外部链接,社交链接,图像,视频或形式类别

'Category' – the category that you want to show up, use something broad like external links, social links, images, videos, or form.

操作 - 这是发生的动作;一些用户这样做,你正在跟踪。对于操作属性中使用的点击,提交的文件,复制或无论你是从用户的跟踪。

'Action' – This is the action that occurred; something the user did that you are tracking. For the ‘Action’ property use clicked, submissions, copy or whatever you are tracking from the user.

'可选标签 - 这就是你不需要任何可选字段,但是当你开始跟踪了很多的东西要能够将它分段出。对于此属性,想想它像一个特定类别例如,脸谱,箱2,或标题图片。

'Optional Label' – This is an optional field you don’t need anything, but when you start tracking a lot of stuff you want to be able to segment it out. For this property think of it like a specific category for example, facebook, box 2, or headline picture.

可选值 - 这是您要跟踪的东西一个数值。没有必要把周围的数值引号,因为它的一个数字。

Optional Value – This is a number value for the thing you are tracking. There is no need to put quotes around the numerical value because its a number.

'可选互动 - 这个人是有点棘手,这是一个布尔值,它的默认值是假的,所以如果你不把任何东西会是假的。假意味着它不会碰你的跳出率,但真正意味着它不会指望这次访问作为一个反弹。

'Optional Interaction' – This one is a little tricky, it’s a Boolean value and it’s default is false, so if you don’t put anything it will be false. False means it won’t touch your bounce rate, but true means that it won’t count that visit as a bounce.

如果你想跟踪点击一个按钮,你可以做一对夫妇的方式。最简单的办法是只的JavaScript添加到HTML中的的onclick = 属性。

If you wanted to track clicks on a button you can do it in a couple ways. The easy way is to just add the javascript to the onclick= attribute in html.

<button id='button1' onclick=_gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])> Button Text </button>

不过,在技术上你不想JS与HTML混合。它适合于小的东西,但如果你创建事件侦听它的更好。

However, technically you don't want JS mixed in with HTML. It's fine for small stuff but it's better if you create event listeners.

您可以用jQuery做到这一点非常轻松地这是基本的点击上述HTML按钮跟踪。

You can do this really easily with jquery. Here is basic click tracking on the HTML button mentioned above.

$('#button1').click(function(){
 //fires the event tracking method when button is clicked.    
 _gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])
})

特别是你在找什么跟踪?

What in particular are you looking to track?

注意:的布局analytics.js中改变(通用Analytics),你可以阅读有关的这里

Note: the layout changed in analytics.js (Universal Analytics) you can read about that here.

这篇关于如何记录谷歌分析每一刻?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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