即使在一天

时间:2017-02-01 07:32:01

标签: firebase firebase-analytics

我正在设置用户属性,但我没有在Firebase控制台中获取任何数据。:

  1. 我已将 favorite_food 注册为firebase控制台中的用户属性。

  2. 我使用下面的代码来注册事件和设置属性

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "TempId");
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "TempName Oncreate");
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT,bundle);
    
    mFirebaseAnalytics.setUserProperty("favorite_food", "INDIAN FOOD");
    
  3. 我在执行代码后等了一天,但我的自定义属性中没有收到任何数据。以下是我从Firebase服务获取的日志。请帮帮我。

    02-06 11:04:25.469 7341-24523/test.testfcm D/FA: Setting user property (FE): favorite_food, pizza
    
    02-06 11:04:25.489 7341-24523/test.testfcm V/FA: Using measurement service
    
    02-06 11:04:25.489 7341-24523/test.testfcm V/FA: Connection attempt already in progress
    
    02-06 11:04:25.489 7341-24523/test.testfcm V/FA: Using measurement service
    
    02-06 11:04:25.489 7341-24523/test.testfcm V/FA: Connection attempt already in progress
    
    02-06 11:04:25.489 7341-24523/test.testfcm V/FA: Activity resumed, time: 1093679
    
    02-06 11:04:25.519 7341-24523/test.testfcm D/FA: Connected to remote service
    
    02-06 11:04:25.529 7341-24523/test.testfcm V/FA: Processing queued up service tasks: 3
    
    02-06 11:04:25.609 1300-24541/? V/FA-SVC: Event recorded: Event{appId='test.testfcm', name='select_content', params=Bundle[{item_name=TempName Oncreate, _o=app, content_type=image, item_id=TempId}]}
    
    02-06 11:04:30.599 7341-24523/test.testfcm V/FA: Inactivity, disconnecting from the service
    
    02-06 11:14:25.449 7341-3377/test.testfcm V/FA: Recording user engagement, ms: 600010
    
    02-06 11:14:25.449 7341-3377/test.testfcm V/FA: Using measurement service
    
    02-06 11:14:25.449 7341-3377/test.testfcm V/FA: Connecting to remote service
    
    02-06 11:14:25.459 7341-3377/test.testfcm V/FA: Activity paused, time: 1693688
    
    02-06 11:14:25.479 7341-3377/test.testfcm D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=600010, _sc=MainActivity, _si=367007112786571721}]
    
    02-06 11:14:25.489 7341-3377/test.testfcm V/FA: Using measurement service
    
    02-06 11:14:25.489 7341-3377/test.testfcm V/FA: Connection attempt already in progress
    
    02-06 11:14:25.509 7341-3377/test.testfcm D/FA: Connected to remote service
    
    02-06 11:14:25.509 7341-3377/test.testfcm V/FA: Processing queued up service tasks: 2
    
    02-06 11:14:25.559 1300-3389/? V/FA-SVC: Event recorded: Event{appId='test.testfcm', name='_e', params=Bundle[{_o=auto, _et=600010, _sc=MainActivity, _si=367007112786571721}]}
    
    02-06 11:14:30.539 7341-3377/test.testfcm V/FA: Inactivity, disconnecting from the service
    

1 个答案:

答案 0 :(得分:0)

我在记录事件后设置了用户属性。它应该在记录任何事件之前。我改变了下面的代码及其工作原理。

    mFirebaseAnalytics.setUserProperty("favorite_food", "INDIAN FOOD");
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "TempId");
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "TempName Oncreate");
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT,bundle);