Last updated: 2021-01-26
Setting up parameters for contextual support
When a customer is visiting your website, portal, or app — they might want to reach out to get help. Setting up a bot in these places will thus help your customers get help faster. Using parameters, you can fetch customer information and offer contextual help to your customers. With Freddy Self-service you can make use of default parameters (that we offer out of the box), and custom parameters (that you can set up).
You can choose to turn on any of the parameters that you want to include in the bot script. This will include the code for the parameters in the bot widget script. You can choose to prefill these parameters with the placeholders that you use in your support portal, website, mobile apps.
Now, when your customers use your portal, website, or app, these placeholders will be filled with values respective to the customer. Since these placeholders are now a part of the bot script, you can pass the parameters and their values to the bot to provide a personalized, customer experience.
Deploying your bot:
You can generate the bot widget script from the Generate script page for each bot. You can copy and paste this script on all your support mediums (portals, webpages, etc.) to deploy it. Any changes you make to the bot configuration will automatically reflect in the bot widget, so you will need to paste this script only once on the required support mediums.
``` Note: If values are not passed for mandatory parameters, the bot widget will not load. To avoid this, you can prefill a default value for mandatory parameters in the Generate script page ```
A quick guide to setting up Default Parameters:

A quick guide to setting up custom parameters:
Sometimes the parameters for their information may not be readily available as a placeholder. In that case, you can make use of the new custom parameters that we offer to fetch this information.
- JS: If the source is selected as JS, you can choose to save the information as part of either the ticket details or the customer details. When JS is chosen, the script that is generated upon clicking the Generate script button will contain this parameter as a variable. This variable will be a key with its value either hardcoded or fetched dynamically and assigned from the website the script is to be pasted on.


``` Note: If the custom param of Source JS is marked as mandatory, make sure that the value is available and is fetched from the website for the defined variable - the bot will not load otherwise. ```

While setting up the script to embed the bot widget, you can notice how the embed code will contain the default and the custom parameter values. You can even populate these values using liquid placeholders on the Generate script screen. You can also populate these values with a JS function response.

In this example, we’ve set up the bot script to have two default parameters and two custom parameters. We are also prefilling one of each. Notice that the prefilled values are also part of the script. You can choose to prefill them constantly or have a variable that can be populated with a JS function on your website.
A quick guide to using Parameters:

``` Note: Make sure that the API related to the custom param is being called under the Actions tab before using it in a dialog - the values will be fetched only if the API is configured as part of Trigger API under Actions. ```
Please write to freshbots-support@freshworks.com if you have any more questions; we’ll be happy to help you.