Track events and user actions when the user starts a new conversation. Attach custom metadata to every conversation started via the SDK.
All the public APIs in the SDK should be called after initializing the SDK via Helpshift.install() API
You can attach tags while reporting an issue by passing them to the configMap
object at the time of calling Helpshift.showConversation(this, configMap)
. You can pass an array of strings with a key "tags"
which will get added as Tags when the issue is created.
For example:
Map<String, Object> config = new HashMap<>(); config.put("tags", new String[]{"foo", "bar"}); Helpshift.showConversation(MainActivity.this, config);
On tag names & compatibility
You can attach additional metadata to every new conversation started by the app user. This metadata can include properties like username, email, game scores, current game levels, and any other data needed to provide relevant context for each new conversation. You can attach custom metadata by passing it to the configMap
object at the time of calling any of the SDK X APIs (showConversation
, showFAQs
, showSingleFAQ
, showFAQSection
) like Helpshift.showConversation(this, configMap)
.
Use code:
HashMap<String, String> customMetadata = new HashMap<String, String(); customMetadata.put("usertype","paid"); customMetadata.put("level","7"); customMetadata.put("score","12345"); HashMap<String, Object> config = new HashMap<>(); config.put("customMetadata", customMetadata); Helpshift.showConversation(MainActivity.this, config);
Metadata should only be sent as String key-value pairs.
If you want to set Custom Issue Fields at the time of Issue creation, follow the steps.
Map
Map
"type"
and "value"
for that custom issue fieldconfigMap
with key "customIssueFields"
of the Helpshift.showConversation(this, configMap)
Map<String, Object> joiningDate = new HashMap<>(); joiningDate.put("type", "date"); joiningDate.put("value", 1505927361535L); Map<String, String> stockLevel = new HashMap<>(); stockLevel.put("type", "number"); stockLevel.put("value", "1505"); Map<String, String> employeeName= new HashMap<>(); employeeName.put("type", "singleline"); employeeName.put("value", "Bugs helpshift"); Map<String, String> isPro = new HashMap<>(); isPro.put("type", "boolean"); isPro.put("value", "true"); Map<String, Object> cifMap = new HashMap<>(); cifMap.put("joining_date", joiningDate); cifMap.put("stock_level", stockLevel); cifMap.put("employee_name", employeeName); cifMap.put("is_pro", isPro); Map<String, Object> config = new HashMap<>(); // other configs... //.. config.put("customIssueFields", cifMap); Helpshift.showConversation(MainActivity.this, config);
The following are the valid values for the type
key of a Custom Issue Field.
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 |
Applicable to SDK X v10.1.0 & above
Breadcrumbs can be used to track events or end-user actions. It helps you to add debugging information regarding end-user actions, which will be passed along with every new conversation on Helpshift’s Agent Dashboard. To leave breadcrumbs, use leaveBreadCrumb
API —
For example:
Helpshift.leaveBreadCrumb("Any breadcrumb string");
Breadcrumbs are collected within the set breadcrumb limit. The limit is set under the SDK Configurations section for App Settings in the Helpshift’s Agent Dashboard. Breadcrumbs are collected in a FIFO queue. If you want to clear the breadcrumbs, use the clearBreadCrumbs
API —
For example:
Helpshift.clearBreadCrumbs();
Applicable to SDK X v10.1.0 & above
You may wish to pass additional debug logs with every new conversation filed by an end-user on Helpshift’s Agent Dashboard. This can be achieved by using com.helpshift.HSDebugLog
.
For example:
HSDebugLog.d("TAG", "Any Debug log string");
Debug logs are collected within the set debug logs limit. The limit is set under the SDK Configurations section for App Settings in the Helpshift’s Agent Dashboard. Debug logs are collected in a FIFO queue.