简体   繁体   中英

Google analytics custom screen names in Easy Tracker

I have an application with a reused activity (its used for different purposes so just tracking the activity name would not help me, thats why I want to define the screen name manually while still using the EasyTracker. My code looks like this:

EasyTracker t = EasyTracker.getInstance(this);
t.set(Fields.SCREEN_NAME, screenName);
// MapBuilder map = MapBuilder.createAppView();
// map.set(Fields.SCREEN_NAME, screenName);
// t.send(map.build());
t.activityStart(this);

I got these information from https://developers.google.com/analytics/devguides/collection/android/v3/screens

I dont want to do this without the EasyTracker because I didn't find any information what exactly happens in the methods activityStart() and activityStop() of the easy tracker so I cant reproduce this behaviour with a custom tracker and I think the inforation which is collected in the activityStart() method in addition to the screen name is also very usefull. So has someone experience with defining custom values in the easy tracker? Is it a good way to do it this way or is there a better solution?

If anyone comes across the question, the as per the v3 of the Google Analytics SDK,

    EasyTracker.getInstance(this).activityStart(SCREEN_NAME);  // Add this method.

where SCREEN_NAME is the user defined constant for the reused Activity.

Using custome screen names instead of the default ones ie the full qualified path name of the Activity doesn't cause any issues in data collection.

Recommendation, Use Google Tag Manager for your Tracking purpose, it provide you better flexibility like changing the UA property ID in future as well the screen names to be sent to Google Analytics. Read more @ Developer Guide For Android

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