简体   繁体   中英

do I need to put firebase analytics codes in each activity in my app?

do I need to put this firebase analytics codes in each activity in my app? the code is:

private FirebaseAnalytics mFirebaseAnalytics;

mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);

Google Analytics tracks many events automatically when you include the SDK, such as when the app is opened, and certain types of activities . For a list of these see automatically collected events .

If you want to track more events, you can log them yourself from your application code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM