Note: The new help widget is being rolled out in batches. You can request early access for your account here.

Once you've chosen the customer service options that need to appear on the widget, and customized its appearance, you can go to the Embed code tab and copy the widget's code. Paste this code into your website or product, where you want the widget.

Once you’ve embedded the help widget, you can customize it further using our Javascript APIs. For example, you can hide the widget on certain pages by calling the method FreshworksWidget('destroy'). You can even pre-populate certain ticket fields when your customers open the contact form.

This article explores the APIs which you can use to customize the widget and shows how you can leverage them to provide a better experience for your customers. 

Identify API: 

When your customers are logged in they try to reach out to you, you can automatically have their name and email pre-filled in the contact form using the identify API

Here's an example of the code for the identify API. You'll have to substitute the 'variable_name' and 'variable_email' with the variables that you use for passing the customer's name and email, respectively.

FreshworksWidget('identify', 'ticketForm', {
  name: 'variable_name',
  email: 'variable_email',

Pre-fill API:

If a transaction fails for a customer, they’ll require your help. This link can be configured so that the widget opens when the link is clicked. You can even set up the widget to pre-fill certain fields in the widget. For example, the 'Type' dropdown can be prefilled as 'Transaction issue'. This way, you can route the question to the appropriate group faster, without the customer having to manually categorize the ticket for you.

Here's a piece of code using which you pre-fill the 'Type' field. You can check out the API documentation to learn more about how you can pre-populate any field in the contact form.

FreshworksWidget('prefill', 'ticketForm', {
type: ‘Transaction issue’

Hide API:

Sometimes, you might have set up ticket fields to categorize tickets internally, so that they can be routed to the right group. If you don't want your customers to worry about those fields, you can hide them in the contact form. 

For example, let’s say you’ve prefilled the 'Type' field as 'Pricing question', you can then use the hide API to hide it from your customers so that they don’t change it.

FreshworksWidget('hide', 'ticketForm', ['type'])

You can also hide any custom field in the contact form. If you're hiding a required field, it needs to pre-filled. 

Clear API:

Using the clear API, you can clear the fields that were previously pre-filled. This does not clear the name and email you may have filled using the identify API.


Multilingual support

You can learn more about how you can use the help widget to provide support in different languages here.