Live Helper Chat support forum.. Old google groups forum can be found here
You are not logged in.
Pages: 1
Hi!
Please help with my question:
I added column "onlyname" (variable name - lhc.onlyname) and variable "onlyname" (JavaScript variable value - window.lhc_var.attr_str_1, Variable identifier - lhc.onlyname). Then I chatted with bot for a while.
After that when I look at dashboard column "onlyname" is empty. What am I doing wrong?
<script>
if (typeof lhc_var === 'undefined'){
window.lhc_var = {}; // Window is required to define variable in global scope
};
lhc_var.nick = 'my full name';
lhc_var.email = ***.com';
lhc_var.pin = '';
lhc_var.phone = '';
lhc_var.loginad = 'ad';
lhc_var.usernamepassing = 'ad';
lhc_var.attr_str_1 = 'my first name and middle name';
var LHC_API = LHC_API||{};
LHC_API.args = {mode:'widget',lhc_base_url:'//172.30.105.100/index.php/',wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:true,theme:1,check_messages:false,lang:'rus/'};
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.setAttribute('crossorigin','anonymous');
po.async = true;
var date = new Date();
po.src = '//172.30.105.100/design/defaulttheme/js/widgetv2/index.js?'+(""+date.getFullYear() + date.getMonth() + date.getDate());
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
Last edited by Snake19 (2020-10-23 10:53:56)
Offline
Please read documentation how properly define define additional chat variables. It's addifional variable you are passing so lhc.onlyname is invalid.
Offline
I have added few more samples to be more explicit. Should clarify everything now.
https://doc.livehelperchat.com/docs/cus … -variables
Offline
Thank you a lot, remdex! Now with "additional_data.myVariable" I can pass my variables.
Offline
I've got simmilar question - how can I pass additional variables in bot messages. E.g. I want to bot to greeting me with my name (not full name) - "Hi, {additional_data.only Name}, welcome you!"
How can I do that?
Offline
Offline
Thanks! I got it via {lhc.add.myfield}.
Offline
Pages: 1