javascript 谷歌分析事件跟踪没有出现

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21153171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 20:14:24  来源:igfitidea点击:

Google Analytics Event Tracking not showing up

javascriptjquerygoogle-analyticstracking

提问by Aldee

I have this problem with google analytics wherein I cannot find the counted data to appear under the Behavior > Events > Top Events.

我在谷歌分析中有这个问题,其中我找不到出现在行为 > 事件 > 热门事件下的计数数据。

I am using the classic analytics. Here is the code I have:

我正在使用经典分析。这是我的代码:

    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-xxxxxxxx-1']);
      _gaq.push(['_setDomainName', 'domain.com']);
      _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>


    <script>
      // custom events:

      $(function() {

        $('button').each(function(){
            $(this).html($(this).data('event'));
        });

        $('button').click(function(){
            var event = $(this).data('event');
            _gaq.push(['_trackEvent', 'USER_INTERACTION', event, 'whatever babe']);
            console.log(event);
        });

      });


    </script>


    <button type="button" data-event="CLICKS_BUTTON_1"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_2"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_3"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_4"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_5"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_6"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_7"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_8"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_9"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_10"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_11"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_12"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_13"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_14"></button><br />
    <button type="button" data-event="CLICKS_BUTTON_15"></button><br />

However, under the real time section, the event tracking data appeared and is okay. Is there any other necessary things (code) to implement in order to make it appear in the behaviour > events section?

但是,在实时部分下,事件跟踪数据出现并且还可以。为了使其出现在行为> 事件部分,是否还有其他必要的东西(代码)需要实现?

回答by Petr Havlik

Aldee,

奥尔迪,

if the events show up in Real Time reports, then you are certainly fine and your setup is correct.

如果事件显示在实时报告中,那么您当然没问题并且您的设置是正确的。

Real Time reports also reflect the filter setup, so if you can see the events fired by the users on your website, just be patient and wait for the raw data to be processed and displayed in Events report.

实时报告也反映了过滤器设置,因此如果您可以在您的网站上看到用户触发的事件,请耐心等待原始数据被处理并显示在事件报告中。

The data processing has changed recently and you can find all the details in the official GA documentation - see Data Limits section.

数据处理最近发生了变化,您可以在官方 GA 文档中找到所有详细信息 - 请参阅数据限制部分

Processing latency is 24-48 hours. Standard accounts that send more than 200,000 visits per day to Google Analytics will result in the reports being refreshed only once a day. Daily processing begins at 12:00 UTC and continues for approximately 10 hours. This can delay updates to reports and metrics for up to two days. To restore intra-day processing, reduce the number of visits you send to < 200,000 per day.

处理延迟为 24-48 小时。每天向 Google Analytics 发送超过 200,000 次访问的标准帐户将导致报告每天仅刷新一次。每日处理从 12:00 UTC 开始,持续大约 10 小时。这可能会将报告和指标的更新延迟最多两天。要恢复日内处理,请将您发送的访问次数减少到每天 < 200,000。

Hope this helps.

希望这可以帮助。