Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Pages: 1
good day, thanks in advance for liver helper chat. I want to read a javascript variable from my bot but I couldn't, could you help me?
JavaScript:
const valores = window.location.search;
const urlParams = new URLSearchParams(valores);
var empresaGET = urlParams.get('empresa');
if (typeof lhc_var === 'undefined') { // This variable has to be defined before Live Helper Chat embed script.
window.lhc_var = {}; // Window is required to define variable in global scope
};
lhc_var.empresa = empresaGET;
BOT:
Command -> Set variable [not visible by operator]
Set chat variables in JSON format.
In this part I have not been able to make LHC read my javascript variable:
{"empresa":"{lhc_var.empresa}"}
Offline
See these. Every replaceable variable is support in any other response.
https://doc.livehelperchat.com/docs/bot … -variables
Offline
Pages: 1