如何使用 Firebase Analytics 定义受众?

How to define an Audience with Firebase Analytics?

我想通过使用自定义属性将他们分开来跟踪我的应用程序的受众。每个用户都有一个权限列表。我希望能够在登录到我的应用程序时使用此属性将它们分开。

目前,所有用户都属于"Alls Users"类别,而不是他们各自的类别...我使用CEO登录超过10次,我等了几天...仍然,我只看到受众名称 'All Users' 递增,而不是我自定义的 'CEO' 受众。

这是我设置属性的方法:

注意: 在我这里的例子中,假设 getRole() 返回的用户角色是 'CEO'

在我的LoginActivity.java

    for (EntityRole mRole : new ArrayList<>(profile.getRoles())) {
        mRole.setUser(profile);
        GenericDAO.getInstance(EntityRole.class).addOrUpdate(mRole);
        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.SIGN_UP_METHOD, mRole.getRole());
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN, bundle);
    }

这是我在 Firebase 中的设置:

结果如下:

请记住,只有在您定义之后,受众才会开始积累成员。因此,在您定义此受众后,一旦至少 10 个登录事件被记录为 sign_up_method,其中包括 "CEO",您将在 Firebase Analytics 中看到您的结果。 Firebase Help Center.

中有关受众的更多信息

我从 Firebase 支持那里收到了这个:

Hi,

Thanks for reaching out to the Firebase Support. Sorry we couldn't get back to you anytime sooner as we are experiencing a high inflow.

I can see your question on Stack overflow and conversion with a engineer. In order to proceed further with the investigation, I would like to know if you tried logging the events using the debug mode?

Use verbose debug output to confirm successful event logging or identify problems with setup. To enable verbose logging on each platform, follow these steps :

Android adb shell setprop log.tag.FA VERBOSE adb shell setprop log.tag.FA-SVC VERBOSE adb logcat -v time -s FA FA-SVC

iOS Pass this argument on launch in Xcode : -FIRAnalyticsDebugEnabled

In addition to this can you check to see if you have applied any filter applied from previous report. This can often cause a report to show no data if it doesn't have any users that meets the criteria. Make sure to clear any filters if you want to step back to a high-level overview.

Regards, Animish