Title: Custom variables in LiveChat plugin
Last modified: November 8, 2017

---

# Custom variables in LiveChat plugin

 *  Resolved [happybb03](https://wordpress.org/support/users/happybb03/)
 * (@happybb03)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/custom-variables-in-livechat-plugin/)
 * Hello guys!
 * I’d like to ask if it would be possible to add some custom variables to your 
   LiveChat plugin, based on your documentation: [https://docs.livechatinc.com/js-api/#tracking-code](https://docs.livechatinc.com/js-api/#tracking-code)?
 * From what I can see, there are no additional options available in the plugin’s
   configuration so I’m wondering if you could offer a workaround 🙂 Thank you for
   your help!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Text](https://wordpress.org/support/users/livechat/)
 * (@livechat)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/custom-variables-in-livechat-plugin/#post-9664033)
 * Hello [@happybb03](https://wordpress.org/support/users/happybb03/),
 * Thank you very much for reaching us with this case!
 * At the moment, I’m afraid that we do not have the possibility to add Custom Variables
   to LiveChat plugin. Don’t worry though! There is a workaround that I can offer.
   Please follow the steps below:
 * 1. First, disable and then delete your current LiveChat plugin.
    2. Open your
   [LiveChat application](https://my.livechatinc.com/) and go to Settings > Installation
   > [My website](https://my.livechatinc.com/settings/code). 3. From there, copy
   your LiveChat code and modify it with Custom Variables that you’d like to add.
   You can use our [documentation for developers](https://docs.livechatinc.com/js-api/#tracking-code)
   that you have referred to in your previous post.
 * After modifying, your code should look like this (where XXXXX represents your
   license number):
 *     ```
       <script type="text/javascript">
       window.__lc = window.__lc || {};
       window.__lc.license = XXXXX;
       window.__lc.params = [
         { name: 'Login', value: 'joe_public' },
         { name: 'Account ID', value: 'ABCD1234' },
         { name: 'Total order value', value: '$123' }
       ];
   
       (function() {
         var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
         lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
       })();
       </script>
       ```
   
 * 4. All that is left is to paste the modified code into the `footer.php` file 
   of your current WordPress template. To do that, enter your WordPress administration
   panel. Typically you have to go to Appearance section > from there, choose **
   Editor**.
    5. On the right you will find the list of available files. To continue,
   Choose `footer.php` and paste your LiveChat code, right before the closing `</
   body>` tag. 6. After pasting the code, click on **Update file** to finalize.
 * From now on, your LiveChat will appear on the website but this time it’ll gather
   additional details and display them for your agents, straight during a chat! 
   🙂 Also, adding Custom Variables during your plugin configuration is something
   that we added to our feature request. We’ll let you know in case that it would
   be implemented!
 * [@happybb03](https://wordpress.org/support/users/happybb03/), I hope that we 
   were able to help! Please don’t hesitate to ask in case of any additional questions.

Viewing 1 replies (of 1 total)

The topic ‘Custom variables in LiveChat plugin’ is closed to new replies.

 * ![](https://ps.w.org/wp-live-chat-software-for-wordpress/assets/icon-256x256.
   png?rev=3023632)
 * [LiveChat - Live Chat Plugin for WP Websites](https://wordpress.org/plugins/wp-live-chat-software-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-live-chat-software-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Text](https://wordpress.org/support/users/livechat/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/custom-variables-in-livechat-plugin/#post-9664033)
 * Status: resolved