Track events and user actions when the user starts a new conversation. Attach custom metadata to every conversation started via the SDK.
You can set the name and email for the user, using
setName:andEmail:
API
For example:
[HelpshiftCore setName:@"John Doe" andEmail:@"john.doe@email.com"];
The SDK prefills the previously used name and email in the new conversation screen. If you want to clear these prefilled fields, set both arguments to nil.
[HelpshiftCore setName:nil andEmail:nil];
The name and email shows up in the issue's sidebar in the agent dashboard -
The users can change their name and email in the new conversation screen.
If you have an identification for your users, you can specify
that as well using loginWithIdentifier:withName:andEmail:
API
For example:
[HelpshiftCore loginWithIdentifier:@"unique-user-id-746501" withName:@"John Doe" andEmail:@"john.doe@app.com"];
This shows up in the issue's sidebar in the agent dashboard -
If you have an external dashboard to manage your Users, you can also link the User ID in Helpshift to the User’s page in your dashboard. Use {user_id} variable to create user specific links. For example, the link http://company.com/users/{user_id} will result in something like http://company.com/345678
In issue sidebar in the agent dashboard, other issues by the same user are also matched using user identifier. So make sure it is unique for each user.
These APIs give multiple users the ability to chat with agents on the same app -
You can login a user via loginWithIdentifier:withName:andEmail:
API
The identifier uniquely identifies the user. Name and email are optional. It is the app developer's responsibility to make sure that the identifier is unique.
For example:
[HelpshiftCore loginWithIdentifier:@"unique-user-id-746501" withName:@"John Doe" andEmail:@"john.doe@app.co"];
The logout
API will logout the currently logged in user. After logout, Helpshift falls back to the default login.
For example:
[HelpshiftCore logout];
leaveBreadCrumb
API to pass user login related crumbs, please make sure to call the clearBreadCrumsbs
API when you change the login.setName:andEmail:
only if loginWithIdentifier:withName:andEmail:
is not being used.setName:andEmail:
is used when already logged in, then it will overwrite the logged in user name and email.loginWithIdentifier:withName:andEmail:
immediately when your app user logs in.loginWithIdentifier:withName:andEmail:
before any support API calls, for it to take effect.Breadcrumbs will help you track events or user actions and when user
starts a new conversation, these breadcrumbs can be seen along with the conversation in
the admin site. To leave breadcrumbs can use [leaveBreadCrumb:
]
[HelpshiftSupport leaveBreadCrumb:@"Custom String"];
Breadcrumbs will be collected within the set breadcrumb limit. This is set in the SDK Configurations section for app settings in the agent dashboard.
Breadcrumbs are collected in a FIFO queue. If you want to clear the breadcrumbs queue, please use the clearBreadCrumbs
API call.
You can attach additional metadata to every new conversation started by the app user via a very simple mechanism provided by the SDK. This metadata can range from user-name, email etc to game scores, current game levels and any other data relevant to creating a suitable context to each new conversation.
While metadata can be set anytime, it will only be sent to the agent dashboard when customer starts a new conversation.
The macOS SDK allows adding of metadata by using reserved constant key HelpshiftSupportCustomMetadataKey
and
NSDictionary as its value in withOptions:
param of support API's,
showConversation:withOptions:
showFAQs:withOptions:
showFAQSection:withController:withOptions:
showSingleFAQ:withController:withOptions:
The SDK will send data which is given as NSDictionary in options as custom data for the new conversation.
Example usages:
NSDictionary *metaData = @{@"usertype": @"paid", @"level":@"7", @"score":@"12345"]}; [HelpshiftSupport showConversation:self withOptions:@{HelpshiftSupportCustomMetadataKey: metaData}];
You can use the
setMetadataBlock:
API to provide a block which returns an NSDictionary
object containing the key-value pairs which make up the metadata.The
signature of the metadataBlock is typedef NSDictionary* (^metadataBlock)(void);
[HelpshiftSupport setMetadataBlock:^(void){ return [NSDictionary dictionaryWithObjectsAndKeys: @"xyz", @"name", @"xyz@abc.com", @"email", gameObject.level, @"level", gameObject.score, @"score", nil]; }];
Please make sure that the objects and keys are NSStrings only. HelpshiftSupportCustomMetadataKey
will take preference over setMetadataBlock
On tag names & compatibility
You can attach tags with metadata to every new conversation via a reserved key constant
HelpshiftSupportTagsKey
to be used with setMetadataBlock:
API or to pass in withOptions:
of support APIs
(of type NSDictionary
) to pass NSArray
(of only NSStrings
) which 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.
NSDictionary *metaDataWithTags = @{@"usertype": @"paid", @"level":@"7", @"score":@"12345", HelpshiftSupportTagsKey:@[@"feedback",@"paid user",@"v4.1"]}; [HelpshiftSupport showFAQs:self withOptions:@{@"gotoConversationAfterContactUs":@"YES", HelpshiftSupportCustomMetadataKey: metaDataWithTags}];
You can also use the
setMetadataBlock:
API to pass tags.
[HelpshiftSupport setMetadataBlock:^(void){ return [NSDictionary dictionaryWithObjectsAndKeys:@"xyz", @"name", @"xyz@abc.com", @"email", [NSArray arrayWithObjects:@"feedback",@"paid user",nil], HelpshiftSupportTagsKey, nil]; }];
Assume you have your own custom logging mechanism for apps that returns a URL (which takes you to your relevant log viewer), and you would want that URL to be sent with each new conversation the user initiates.
Say you have a button "Send Feedback" in your application whose touch event is linked to a method sendFeedback: where you want to call Helpshift showConversation:
or any other support session.Then you can implement something like:
- (IBAction) sendFeedback:(id) sender { // Manage your UI for posting logs and retrieving URLs // Post logs and retrieve URL Send logs to your custom logs server Retrieve log URL from response // Set metadata with URL [HelpshiftSupport setMetadataBlock:^(void){ return [NSDictionary dictionaryWithObjectsAndKeys: URL, @"logURL",nil]; }]; // Call Helpshift showConversation [HelpshiftSupport showConversation:self]; }
Please make sure that the metadata is already present before presenting any support session.
Helpshift SDK includes support for archiving issues. Issues in Resolved or Rejected state for more than 12 months will be automatically archived. Once archived, issues cannot be reopened. This improves dashboard performance. Archived issues will be accessible to agents through the dashboard for future reference.