• Resolved happybb03

    (@happybb03)


    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 ?

    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 LiveChat

    (@livechat)

    Hello @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 and go to Settings > Installation > My website.
    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 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://' : 'https://') + '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, 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.