Tracking

Track users and attach metadata via Web Chat widget.

Name and Email

You can set the name and email for the user in the helpshiftConfig at the time of initialization.

For example:

// Make this change to the embed code placed before the closing </body> tag.

window.helpshiftConfig = {
  platformId: "<YOUR_APP_ID>",
  domain: "<YOUR_DOMAIN>",
  userName: "John Doe", // Example
  userEmail: "john@doe.com" // Example
};

The name and email shows up in the issue's sidebar in the Agent Dashboard -

username-email-admin.png

User Identifier

If you have an identification for your users, you can specify that as well in the helpshiftConfig while initializing.

For example:

// Make this change to the embed code placed before the closing </body> tag.

window.helpshiftConfig = {
  platformId: "<YOUR_APP_ID>",
  domain: "<YOUR_DOMAIN>",
  userId: "unique-user-id-1234-5678" // Example
};

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/unique-user-id-1234-5678

The User identifier should always be unique for each user.

In the Issue sidebar in the Agent Dashboard, other Issues by the same user are also matched using the user identifier. So make sure it is unique for each user.

other-issues-by.png

Logged in Users

A logged in end user is someone who can only use the Web Chat on a page that is only accessible with a username and password.

The widget assumes that if you pass the user identifier of a user, that means that user is logged in.

Different browsers (including incognito mode) and different platforms will be treated as unique Web Chat interactions.

Public User

A public end user is someone who can access the Web Chat on a publicly accessible page that is not behind a username and password.

If user identifier is not passed to the widget via helpshiftConfig, the widget assumes that user is currently not logged in.

You will have to call the reset method, if you want to clear the conversation once user logs out.

The Web Chat Widget will retain the conversation state for 12 hours by default. You can configure this value using the resetTimeout configuration.

Adding Tags to Conversations

You can attach tags while reporting an issue by passing them to the helpshiftConfig object at the time of initialization. You can pass an array of strings which will get added as Tags when the issue is created.

For example:

// Make this change to the embed code placed before the closing </body> tag.

window.helpshiftConfig = {
  platformId: "<YOUR_APP_ID>",
  domain: "<YOUR_DOMAIN>",
  tags: ["foo", "bar"]
};

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, use the following API. This API will merge these fields with previously set fields.

Helpshift("setCustomIssueFields", {
  // Key of the Custom Issue Field
  "version": {
    // Type of Custom Issue Field
    type: "number",
    // Value to set for Custom Issue Field
    value: "10.0"
  },
  "userInfo": {
    // Type of Custom Issue Field
    type: "singleline",
    // Value to set for Custom Issue Field
    value: "We have a new user!"
  }
});

The following are the valid values for the type property 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
  • This API should be called before the Issue is created. You won't be able to update Custom Issue Fields after the Issue is created.
  • If any of the keys, types or values are invalid, that particular Custom Issue Field will get dropped.

Replace Custom Issue Fields

If you want to clear previous Custom Issue Fields and set new fields, use the following API.

Helpshift("replaceCustomIssueFields", {
  // Key of the Custom Issue Field
  "isMobile": {
    // Type of Custom Issue Field
    type: "checkbox",
    // Value to set for Custom Issue Field
    value: true
  },
  "browser": {
    // Type of Custom Issue Field
    type: "dropdown",
    // Value to set for Custom Issue Field
    value: "chrome"
  }
});

This API can be used when you want to navigate from one page to another and set different Custom Issue Fields for each page.