谷歌分析不会在实时概览中显示活跃用户 [英] google analytics doesn't show the active user in Real time overview

查看:21
本文介绍了谷歌分析不会在实时概览中显示活跃用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用中设置了所有使用 google analytics V4 的东西我让一切正常,我可以看到它,但是当我在移动视图中转到实时概览时,我没有看到任何活跃用户

i have setup every thing in my app for using google analytics V4 and i get every things working and i can see it but when i go to real time overview in my mobile view i didn't see any active user

这是我的追踪器

 <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="TypographyDashes">
  <integer name="ga_sessionTimeout">300</integer>

    <!-- Enable automatic Activity measurement -->
    <bool name="ga_autoActivityTracking">true</bool>
    <!-- The screen names that will appear in reports -->
    <screenName name="info.lifepast.MainActivity">MainActivity</screenName>

    <!--  The following value should be replaced with correct property id. -->
    <string name="ga_trackingId">UA-xxx-3</string>
</resources>

和应用程序类是

public class Analytics extends Application {
private static final String PROPERTY_ID = "UA-xxxxx-3";
  public enum TrackerName {
        APP_TRACKER, // Tracker used only in this app.
        GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking.
        ECOMMERCE_TRACKER, // Tracker used by all ecommerce transactions from a company.
    } 

    HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>();
    synchronized Tracker getTracker(TrackerName trackerId) {
        if (!mTrackers.containsKey(trackerId)) {

          GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
          Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
              : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(R.xml.global_tracker)
                  : analytics.newTracker(R.xml.ecommerce_tracker);
          mTrackers.put(trackerId, t);

        }
        return mTrackers.get(trackerId);
      }

}

在我创建的主要活动中,我添加了这个

and in my main activity on create i added this

Tracker t = ((Analytics) this.getApplication()).getTracker(
        TrackerName.GLOBAL_TRACKER);
    GoogleAnalytics.getInstance(this).getLogger().setLogLevel(LogLevel.VERBOSE);
    // Set screen name.
    // Where path is a String representing the screen name.
    t.setScreenName(getString(R.string.app_name));

    // Send a screen view.
    t.send(new HitBuilders.AppViewBuilder().build());

和清单文件

  <meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" /> 
    <meta-data
        android:name="com.google.android.gms.analytics.globalConfigResource"
        android:resource="@xml/global_tracker"/>

有什么帮助吗?

推荐答案

我今天一直在查看 v4 分析,并且在获取要发布的屏幕视图时也遇到了问题.以下是我在调查过程中发现的一些可能对您有所帮助的内容:

I've been looking at the v4 analytics today, and have also had trouble getting screen views to post. Here are a couple things I've dug up during my investigations that may be helpful for you:

  • AppViewBuilder 已弃用,取而代之的是 ScreenViewBuilder(请参阅 HitBuilders 源代码).这部分的文档是,大概已经过时了. 编辑 2015 年 3 月 6 日:似乎链接的文档现已更新为使用 ScreenViewBuilder.

  • AppViewBuilder is deprecated in favor of ScreenViewBuilder (see the HitBuilders source code). This part of the documentation is, presumably, out of date. Edit Mar 6, 2015: it would appear that the linked documentation has now been updated to use ScreenViewBuilder.

如果我对文档的解释是正确的,那么在启用自动活动跟踪功能(我认为是这种情况)时,不需要使用 ScreenViewBuilder 显式发布屏幕视图在您的配置文件中).

If my interpretation of the documentation is correct, it should not be necessary to explicitly post screen views using a ScreenViewBuilder when the auto activity tracking feature is enabled (which I see is the case in your configuration file).

默认情况下,当前日期不包含在您的 Google Analytics(分析)统计信息中.您可以通过手动选择日期范围来选择包含它(请参阅大多数 GA 页面右上角的下拉控件).

By default, the current date is not included in your Google Analytics stats. You can choose to include it by manually selecting a date range (see drop-down control at the top right of most GA pages).

确保缩短调试版本的调度周期 - 默认情况下,事件每 30 分钟分批发送一次,但为了测试,可以将其减少到几秒钟.有关实施详情,请参阅 @vangoz 的回答.

Make sure you shorten the dispatch period for debug builds - by default, events are batched and sent every 30 minutes, but for testing it's ok to reduce this to a few seconds. See the answer from @vangoz for implementation details.

希望能帮到你.

相关,但我看到你已经在那里发布了:适用于 Android 的 Google Analytics API v4 不发送屏幕视图

related, but I see you've already posted there: Google Analytics API v4 for Android Does NOT Send Screen Views

这篇关于谷歌分析不会在实时概览中显示活跃用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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