Collect and track user data

Here's how you can collect and track your Android users' data in HelpCrunch.
Written by Alex
Updated 5 months 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:

HCUser user = new HCUser.Builder()
        .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 attributes, 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.

To create the new customData attribute, go to Settings → Contacts → Custom attributes and click 'Add new attribute'.

Don't use a static field value for the withUserId function!
Each user_id must be unique for unique users or null for anonymous users.

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();

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 5 types of custom data you can search by: integer, float, string, boolean, and date:

Did this answer your question?