Account details

General

Copy and paste these templates to capture useful details about your user’s account.

The most common data developers send themselves is user’s email (e.g. stephanie.smith@gmail.com). Depending on your app, instead of an email, you might want to report their username (e.g. stephanie_smith), user ID (e.g. 10d1ac10572b) or their screen name (e.g. dragon_slayer).

These will come in handy later on when you have to match a bug to a user for example!

App.kt
val currentUser = getLoggedInUser();
val userLoggedIn: Boolean = currentUser.isUserLoggedIn();
if(userLoggedIn) {
Shake.setMetadata("userid", currentUser.id);
Shake.setMetadata("email", currentUser.email);
Shake.setMetadata("userName", currentUser.name);
}

Gaming and education

If your app is in the gaming or education industry, think about sending yourself more specific details about your players or people taking classes, maybe a player’s class (e.g. Wizard), a list of their achievements (e.g. [1, 2, 5, 8, 15]), their difficulty settings (e.g. Beginner) or a list of languages or courses they are taking (e.g. English and Spanish) to get the whole picture about the player without nagging them for more details.

App.kt
val achievements = Array<Achievements>(100);
val courses = Array<Courses>(5);
val difficulty = Difficulty('Begginer');
if(user) {
achievements = user.getUserAchievements();
courses = user.getUserCourses();
difficulty = getCurrentDifficulty();
Shake.setMetadata("achievements", achievements);
Shake.setMetadata("courses", courses);
Shake.setMetadata("difficulty", difficulty);
}

B2B

In a more serious B2B environment, you probably want to always report yourself data like user’s account type (e.g. Admin), their subscription plan (e.g. Free) and similar.

App.kt
val user = getCurrentUser();
if(user) {
Shake.setMetadata("userId", user.id);
Shake.setMetadata("paymentPlan", user.paymentPlan);
Shake.setMetadata("accountType", user.accountType);
}