问题
I am implementing Firebase Analytics in my app.
Everything works fine, I am getting the logged events in my Firebase console, but I am having trouble with the bundle data (Params) that are passed during the logging of event.
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.VALUE, "event Value");
firebaseAnalytics.logEvent(FirebaseAnalyticsConstants.ON_VIEW_EVENT, bundle);
I want to differentiate based on the VALUE param.
回答1:
The VALUE parameter is meant to be numeric. See the documentation on it here.
Of course, you can log any custom parameter you want with your event, but parameter reporting is only currently offered on a subset of suggested events. Alternatively, you can query your raw events, parameters and user properties if you link your app to BigQuery.
回答2:
I faced same issue:
//pass this code in any click event or anywhere.
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString("Category",category);
bundle.putString("Screen",Screen);
firebaseAnalytics.logEvent("MyCustomEvent",bundle);
Pass this command for track:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
not when your app is send event log you will see logs. Custom tag i used android studio's emulator. Geny motion set SDK path from Genymotion: settings-> ADB.
Note: After 15-20 minutes open firebase console, see right side and select today. you will find your custome event.
回答3:
Try this snippet code
findViewById(R.id.tvOrderTitle).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String strClickLogs;
Bundle params = new Bundle();
params.putString("mobileno", logMobileno);
params.putString("name", logName);
params.putString("email", logEmail);
strClickLogs = "Eventlogs_Generated";
Log.e(TAG, strClickLogs);
//Logs an app event.
mFirebaseAnalytics.logEvent(strClickLogs, params);
}
});
You can see genrated logs in verbose in Logcat as below format:
V/FA-SVC: Logging event: origin=app,name=Eventlogs_Generated,params=Bundle[{mobileno=9876543210, firebase_event_origin(_o)=app, firebase_screen_class(_sc)=SupplierListActivity, firebase_screen_id(_si)=7001228486350086694, name=Ashish Tikarye, email=ashisht@set.com}]
来源:https://stackoverflow.com/questions/38125537/firebase-analytics-unable-to-view-the-values-that-are-passed-in-the-event