Hello 👋 How can we help?

Collect and track user data

Here's how you can collect and track your Android users' data in HelpCrunch.
Written by Alex
Updated 2 weeks ago

By default, the HelpCrunch SDK doesn’t require users to enter any of their information before starting a chat conversation with you. You can send user data by yourself or enable our Welcome screen with the attributes that you want users to enter.

Sending User attributes

You can save a user or update user’s data by creating the HCUser object and passing it to the updateUser method:

Java:

HCUser user = new HCUser.Builder()
        .withName("name")
        .withEmail("email")
        .withPhone("phone")
        .build();

HelpCrunch.updateUser(user) //callback is optional

Kotlin:

val user = HCUser.build {
      withName("name")
       withEmail("email")
       withPhone("phone")
       build()
}

HelpCrunch.updateUser(user) //callback is optional

After you have added user’s data, it will appear in your HelpCrunch admin panel right in a chat window:

In addition to user’s name / email / company / phone and ID, HelpCrunch lets you send additional customer attributes as custom data.

With the customData property, you can send any user information you wish to track. Custom data is key/value pairs and can contain numbers, strings or boolean data. You can associate a specific user of your application with a specific HelpCrunch chat using the withUserId option.

Java:

HashMap<String, Object> customData = new HashMap<>();
customData.put("CustomKey1", "CustomObject1");
customData.put("CustomKey2", "CustomObject2");
customData.put("CustomKey3", "CustomObject3");
HCUser user = new HCUser.Builder()
        .withUserId("customUserId")
        .withCustomData(customData)
        .build();

Kotlin:

val user = HCUser.build {
   withUserId("customUserId")
   withCustomData(
         hashMapOf(
               "CustomKey1" to "CustomObject1",
               "CustomKey2" to "CustomObject2",
               "CustomKey3" to "CustomObject3"
         )
   )
   build()
}

Custom data parameters will appear in a chat window in your HelpCrunch admin panel just like main user attributes (name, email, user id) do:

Also, you will be able to use custom data for searching through your Contacts' list. There are 3 types of custom data you can search by: integers, strings and boolean:

Did this answer your question?