Tracking
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 installWithPlatformId API
Multi Login
Details on user management are available here.
Attaching tags with conversation
On tag names & compatibility
- HSTags must be created in the Helpshift Dashboard (Settings → Tags), otherwise they will be ignored.
- HSTags must be lowercase since the dashboard automatically converts tags to lowercase. The tags present on the dashboard must exactly match the HSTags.
You can attach tags to every new conversation in the config object while calling the showConversation API. The passed tags get intepreted at server and added as Tags for the every new conversation.
If an object in NSArray
is not of type NSString
then the object will be removed from Tags and
will not be added for the new conversation.
- Configuration details
- Objective-C
- Swift
NSArray *tags = @[@"Hello", @"iOS"];
NSDictionary *config = @{@"tags":tags};
[Helpshift showConversationWith:self config:config];
let tags = ["Hello", "iOS"]
let config = ["tags":tags]
Helpshift.showConversation(with:self, config:config)
Attaching Custom Metadata to conversations
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 passing it to the config
dictionary at the time of calling any of the SDK X APIs (showConversation
, showFAQs
, showSingleFAQ
, showFAQSection
).
Example:-
- Configuration details
- Objective-C
- Swift
NSDictionary *customMetadata = @{ @"usertype": @"paid",
@"level": @"7",
@"score": @"12345"
};
NSDictionary *config = @{ @"customMetadata" : customMetadata };
[Helpshift showConversationWith:self config:config];
let customMetadata = [ "usertype": "paid",
"level": "7",
"score": "12345" ];
let config = ["customMetadata":customMetadata]
Helpshift.showConversation(with: self, config: config)
Metadata should only be sent as String key-value pairs.
- Once customMetadata is set, if you want to reset it, then you’ll have to call the SDK X API with an empty dictionary, i.e.,
let customMetadata = [String: String]();
let config = ["customMetadata":customMetadata]
Helpshift.showConversation(with: self, config: config)
Attaching Custom Issue Fields to conversations
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
You can attach Custom Issue Fields to every new conversation started by the user. A Custom Issue Field should have a key, a datatype, and a value. The Helpshift SDK allows the addition of Custom Issue Fields by using the customIssueFields
method in the ApiConfig object.
These Custom Issue Fields would be sent whenever a new conversation is started by the end user.
As soon as an end user opens the conversation screen, they see a greeting message, and the conversation is considered active. All the modified Custom Issue Fields (updated during an active conversation) will only be sent with the next conversation that end user starts.
Possible datatypes to be passed into the config are:
Type | value | Comments |
---|---|---|
"singleline" | string | Single line string with character limit of 255 |
"multiline" | string | Multi line string with character limit of 100,000 |
"number" | string | String representation of number. For eg. "12345" |
"dropdown" | string | Drop-down options should exist for the given Custom Issue Field on dashboard. Value should be one of the values specified on the dashbaord for that dropdown. |
"date" | long long int | Epoch time in milliseconds. For eg. 1505927361535 |
"checkbox" | string | String representation of boolean. For eg. "true" or "false". This corresponds to the checkbox type custom issue field on dashboard. |
Example:-
- Configuration details
- Objective-C
- Swift
NSDictionary *cifs = @{ @"joining_date": @{ @"type":@"date", @"value":@1505927361535 },
@"stock_level": @{ @"type":@"number", @"value":@"1505" },
@"employee_name": @{ @"type":@"singleline", @"value":@"ABC" },
@"employee_address": @{ @"type":@"multiline", @"value":@"303,Joy plaza,Park street,Viman nagar.Pune-432123" },
@"salary_currency": @{ @"type":@"dropdown", @"value":@"Dollars" } };
NSDictionary *config = @{ @"customIssueFields" : cifs };
[Helpshift showConversationWith:self config:config];
let cifs = [ "joining_date": [ "type":"date", "value":1505927361535 ],
"stock_level": [ "type":"number", "value":"1505" ],
"employee_name": [ "type":"singleline", "value":"ABC" ],
"employee_address": [ "type":"multiline", "value":"303,Joy plaza,Park street,Viman nagar.Pune-432123" ],
"salary_currency": [ "type":"dropdown", "value":"Dollars" ] ];
let config = ["customIssueFields":cifs]
Helpshift.showConversation(with: self, config: config)
Breadcrumbs
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 —
- Objective-C
- Swift
[Helpshift leaveBreadcrumb:@"any breadcrumb string"];
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 —
- Objective-C
- Swift
[Helpshift clearBreadcrumbs];
Helpshift.clearBreadcrumbs()
Debug Logs
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 using addLog:
API —
- Objective-C
- Swift
[Helpshift addLog:@"any debug log string"];
Helpshift.addLog("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.