> For the complete documentation index, see [llms.txt](https://en.help.firstline.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en.help.firstline.cc/feature/chatbot/scenario/add-data-from-url-parameters.md).

# Add data to the live chat URL

Attach variables to the live chat URL as query string parameters. For example, a customer starts a live chat on your website, and your website already knows the customer's name. You can let the chatbot know the customer's name before the conversation starts, so the bot can have a smarter conversation without asking for the name again.

## Enable**Related**Setup

Go to the single live chat management page, select the "Pass variables to script" tab, enable the setting that allows variables to be passed in via the URL, then save.

![](https://3300265106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MNRu7dk70ei7JV9HlW9%2Fuploads%2FgEw4rxyel4nWTBZvocap%2F%E6%88%AA%E5%9C%96%202022-03-11%2013.16.33.png?alt=media\&token=50c2ab27-abf7-4ffa-a4a3-f4d58a179c33)

## Add variables to the embed URL <a href="#to-add-the-variable-to-an-embedded-bot" id="to-add-the-variable-to-an-embedded-bot"></a>

Append variables to the URL as query string parameters (Query string), for example contact\_name=bruce.wayne. Each parameter pair is separated by "&".

For example:

* You have a variable named location.
* Your live chat URL or embed code is:

```html
<div class=div id="firstline-livechat-app"><iframe-app/></div>
<script src="https://yourwebsite.firstline.cc/livechat.js</script>
```

* To pass information when entering the chat script, you can append location to the URL`=`Query string:

```html
<div class=div id="firstline-livechat-app"><iframe-app/></div>
<script src="https://yourwebsite.firstline.cc/livechat.js?location=Tokyo</script>
```

* Each time you enter the script, the current live chat’s passed information is used as the basis; previously passed information will be cleared.

{% hint style="warning" %}
**Avoid passing sensitive information and using reserved words**

This feature is intended to enrich bot flow use cases. Do not use it to transmit sensitive information via this method, such as credit card numbers, passwords, etc. Also avoid using system default variable names, including **uuid、token、once\_code**, which will not take effect.
{% endhint %}

## **Using variables in conversation scripts or Webhook scripts**

To use variables in the script, such as when sending messages, add the prefix extra\_settings., for example use extra\_settings.contact\_name or extra\_settings.location.

`Hi! Mr./Ms. {{ extra_settings.contact_name }} from {{ extra_settings.location }}, hello! 👋`<br>

![](https://3300265106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MNRu7dk70ei7JV9HlW9%2Fuploads%2FP5CyIyngsBE1RKQZjRoG%2F%E6%88%AA%E5%9C%96%202022-03-11%2013.30.02.png?alt=media\&token=de141020-f1c2-4d0d-8da9-2b1e87a34e45)
