Google Analytics 事件跟踪 - 事件之间的最小间隔 [英] Google Analytics Event Tracking - Minimal Interval between the events

查看:19
本文介绍了Google Analytics 事件跟踪 - 事件之间的最小间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 GA _trackEvent 方法跨多个域跟踪多个事件.

I want to track multiple events using GA _trackEvent method across multiple domains.

由于我要生成的报告的性质,我必须这样做:

Because of the nature of the report I want to generate, I must do something like this:

for (var i=0; var < books.length; i++)
{
   //showing values for current books[i]
   _gaq.push(['_trackEvent', 'Books Displayed', 'Fantasy', 'Lord of The Rings']);
}

因此,当我的图书列表被填充时,我想发送适当的 GA 事件.单独发送每个项目很重要,这样我就可以在事件仪表板上向下钻取以预览幻想"类别中的所有项目等.

So, when my books list is populated I want to send appropriate GA event. It is important that I send each item separately so I can drill-down on Event Dashboard to preview all items in 'Fantasy' category and so on.

请注意,书籍列表永远不会超过 10 项左右.

Note, books list is never longer than about 10 items.

我目前遇到的问题是,Google 代码无缘无故地忽略了我的一些请求.Google 事件跟踪的工作方式是,每次调用 _trackEvent 时,Google 都会在页面上放置 gif:

The problem I'm experiencing at the moment is that for no good reason Google code is ignoring some of my requests. The way how Google event tracking works, is that with every call to _trackEvent, Google is dropping gif on the page:

http://www.google-analytics.com/__utm.gif

有大量参数,其中一个 - utme 包含我的数据:

that has loads of parameters, and one of them - utme contains my data:

__utm.gif?utmt=event&utme=5(Books%20Displayed*Fantasy*Lord%20of%20The%20Rings)

使用 Fiddler(或 Firebug Net 选项卡)我可以检查这个请求是否真的来自浏览器.

Using Fiddler (or Firebug Net tab) I can check if this request is really coming out from the browser.

不幸的是,似乎每次我的一半请求都被谷歌完全忽略_trackEvent 没有被转换为 __utm.gif打电话.

Unfortunately, it seems like every time about half of my requests are completely ignored by google and _trackEvent is not translated to __utm.gif call.

我感觉这与 _trackEvent 调用的频率有关.因为我在 for 循环中使用它们,所以所有事件都以最小的间隔产生.Google 似乎不喜欢它,并忽略了我的电话.

I have a feeling it has something to do with the frequency of the _trackEvent call. Because I am using them inside a for loop, all events are spawned with minimal interval between. It seems like Google doesn't like it, and ignores my calls.

我确实对其进行了测试,在每次调用之间增加了 2 秒的间隔并且它起作用了.但是这个解决方案是不可接受的 - 我不能让用户等待 20 秒来发送所有事件.

I did test it, adding 2 seconds interval between each call and it worked. But this solution is unacceptable - I can't make user wait for 20 seconds to send all events.

不幸的是,此缺陷使 GA 事件跟踪完全无用 - 我不能只是希望"GA 代码正确记录我的事件,因为报告不准确.最糟糕的是,Google 上没有适当的文档说明每秒允许的最大请求数是多少(它们仅 声明每个会话的最大请求数是 500,这比我无论如何生成的要多得多.

Unfortunately this flaw makes GA Event Tracking completely useless - I can't just "hope" GA code will correctly record my event because the report won't be precise. The worst thing about it is that there is no proper documentation on Google saying what is the maximum allowed number of requests per second (they only state that max request per session is 500 what is a lot more than what I generate anyway).

我的问题是 - 您之前在 Google 事件跟踪方面是否遇到过类似的问题,您是如何解决的?或者这是否意味着我必须完全放弃 GA Tracking 因为它永远不够精确?

My question is - did you experience similar problems with Google Event tracking before and how did you manage to fix it? Or does it mean I must completely abandon GA Tracking because it will never be precise enough?

推荐答案

首先,我想指出每个会话 500 的限制是针对所有向 Google 提出的请求,而不仅仅是针对事件.因此,这包括您正在执行的任何其他自定义跟踪,也包括正常的页面浏览点击.

First off, I want to point out that the 500 limit per session is for all requests to Google, not just for events. So that includes any other custom tracking you are doing, and that also includes normal page view hits.

对我来说,这听起来更像是一般的 js 问题而不是 GA 问题.沿着你推动 GA 的代码处理速度比它可以处理的速度更快的东西,所以有些东西正在通过裂缝.我认为除了像你所做的那样延迟每次推送之外,你真的没有什么可以做的......尽管我认为你可以将该间隔从 2 秒降低到可能低至 500 毫秒......但仍然如此最多只能让你等待 5 秒,IMO 比 20 秒好多了,但还是太长了.

This to me sounds more like a general js issue than a GA issue. Something along the lines of you pushing code for GA to process faster than it can process so some are falling through the cracks. I don't think there really is anything you can do about that except for delay each push as you have done...though I think you could probably lower that interval from 2s to maybe as low as 500ms...but still, that would at best drop you down to a 5 second wait, which IMO is a lot better than 20s but still too long.

一种可能有效的解决方案是让您跳过使用 _gaq.push() 并直接为每个标签输出带有 URL 和参数的图像标签.这与异步版本之前出现的传统"GA 代码的原理大致相同,而且大多数其他分析工具今天仍在这样做.

One solution that might work would be for you to skip using _gaq.push() and output an image tag with the URL and params directly for each one. This is sort of the same principle as the "traditional" GA code that came before the async version, and is what most other analytics tools still do today.

如果您想要我的诚实意见...根据我在网络分析方面的经验,我认为这里最有可能的事情是您首先需要重新评估您正在跟踪的内容.

If you want my honest opinion though...in my experience with web analytics, I think the most likely thing here is that you need to re-evaluate what you are tracking in the first place.

根据您的价值观的上下文判断,(这只是一个猜测)在我看来,您有一个页面,用户可以在其中查看书籍列表,例如搜索结果页面或一般特色书籍"页面或类似的页面,并且您想要跟踪用户在该页面上看到的所有书籍.

Judging by the context of your values, (and this is just a guess) it looks to me like you have for instance a page where a user can see a list of books, like a search results page or maybe a general "featured books" page or something similar, and you are wanting to track all the books a user sees on that page.

根据我在网络分析方面的经验,您对收集的数据过于细化.我给您的建议是坐下来问问自己这些数据的可操作性如何?"毕竟,这就是网络分析的重点 - 帮助做出可操作的决策.

Based on my experience with web analytics, you are being way too granular about the data you collect. My advice to you is to sit down and ask yourself "How actionable is this data?" That is, after all, the point of web analytics - to help make actionable decisions.

我整天都看到客户陷入了想要了解事物的每一个细节的陷阱,因为他们认为这会帮助他们回答某些问题或做出某种决定,而在 99% 的情况下,这不会.个人预订用户查看的事件是一回事,例如个人产品详细信息页面,您将在其中跟踪单个事件.

All day long I see clients fall into the trap of wanting to know absolutely every minute detail about stuff because they think it will help them answer something or make some kind of decision, and 99% of the time, it doesn't. It is one thing to track as an event individual books a user views, like an individual product details page, where you'd be tracking a single event.

或者对于搜索结果页面...将其作为搜索"事件进行跟踪,弹出诸如搜索的术语、给出的结果数量等内容,但不提供有关实际返回内容的详细信息.

Or for search results page...track it as a "search" event, popping stuff like what the term searched was, how many results given, etc.. but not details about what was actually returned.

我想如果我知道有关您网站的更多详细信息以及此跟踪的用途,我可能会给您更可靠的建议:/

I guess if I knew more details about your site and what this tracking is for, I could maybe give you more solid advice :/

这篇关于Google Analytics 事件跟踪 - 事件之间的最小间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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