Tracking Android

Track events and user actions when the user starts a new conversation. Attach custom metadata to every conversation started via the SDK.

Adding Tags to Conversations

You can attach tags while reporting an issue by passing them to the configMap object at the time of calling ShowConversation. You can pass an array of strings with a key "tags" which will get added as Tags when the issue is created.

For example:

using Helpshift;

private HelpshiftSdk help;

void Awake(){
    // install call here
}

// configuration map
void openHelpshift(){

    Dictionary<string, object> configMap = new Dictionary<string, object>();
    // other configurations
    // .. 
    configMap.Add("tags", new String[] { "tag1", "tag2" })

    // open the support chat screen
    help.ShowConversation(configMap);
}

On tag names & compatibility

  • Tags must be pre-created in the Helpshift Dashboard (Settings → Tags), otherwise they will be ignored.
  • The attached tags must exactly match the tags present on the dashboard.

Set Custom Issue Fields

If you want to set Custom Issue Fields at the time of Issue creation, follow the steps.

  1. Initialise a top level custom issue fields' Dictionary
  2. Define your custom issue field Dictionary
  3. Add the "type" and "value" for that custom issue field
  4. Add the custom issue field map to top level map (with key as your configured key and value as custom issue field map)
  5. Pass the map to configMap with key "customIssueFields" of the ShowConversation(configMap)
using Helpshift;

private HelpshiftSdk help;

void Awake(){
    // install call here
}

void openHelpshift(){

    Dictionary<string, object> joiningDate = new Dictionary<string, object>();
    joiningDate.Add("type", "date");
    joiningDate.Add("value", DateTimeOffset.UtcNow.ToUnixTimeMilliseconds());

    Dictionary<string, string> stockLevel = new Dictionary<string, string>();
    stockLevel.Add("type", "number");
    stockLevel.Add("value", "1505");

    Dictionary<string, string> employeeName = new Dictionary<string, string>();
    employeeName.Add("type", "singleline");
    employeeName.Add("value", "Bugs helpshift");

    Dictionary<string, string> isPro = new Dictionary<string, string>();
    isPro.Add("type", "boolean");
    isPro.Add("value", "true");

    Dictionary<string, object> cifDictionary = new Dictionary<string, object>();
    cifDictionary.Add("joining_date", joiningDate);
    cifDictionary.Add("stock_level", stockLevel);
    cifDictionary.Add("employee_name", employeeName);
    cifDictionary.Add("is_pro", isPro);


    Dictionary<string, object> config = new Dictionary<string, object>();
    // other configs...
    //.. 
    config.Add("customIssueFields", cifDictionary);

    help.ShowConversation(configMap);
}

The following are the valid values for the type key of a Custom Issue Field.

  • "singleline"
  • "multiline"
  • "number"
  • "checkbox"
  • "dropdown"
  • "date"

Compatibility table for type and values:

Type Value Comments
singleline string Character limit of 255
multiline string Character limit of 100,000
number string
dropdown string Drop-down options should exist for the given Custom Issue Field
date number Epoch time. For example - Date.now()
checkbox boolean

On Custom Issue Fields keys & compatibility

  • Custom Issue Fields must be created in the Helpshift Dashboard (Settings → Custom Issue Fields), otherwise they will be ignored. Read more here