谷歌分析不显示时间真正概述活跃用户活跃、时间、用户

2023-09-05 10:16:12 作者:该账号已注销

我已经安装在我的应用程序的每一件事情,使用谷歌分析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"/>

任何帮助吗?

any help?

推荐答案

我一直在看着今天在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 是pcated赞成 ScreenViewBuilder (请参阅 HitBuilders 源$ C ​​$ C)。 这部分文档是, presumably,过时的修改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.

如果该文件是我除pretation是正确的,它不应该使用 ScreenViewBuilder 当自动活动跟踪明确POST画面的意见是必要的功能启用(这是我看到的是在配置文件的情况下)。

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).

在默认情况下,当前的日期没有包括在你的谷歌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.

希望一些帮助你。

编辑:相关的,但我看到你已经发布的有:Google分析API V4为Android不发送屏幕视图

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