La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
I need help, we have a website with the integration of the hubspot in the contact forms and in the widget of our bot.
However, our widget is loaded before the hubspot by the wordpress footer script.Is there any way to place a callback on the main hubspot script?so that our widget is loaded with the value of the hubspotutk variable?
We are currently trying to get the cookie like this, but our script must 'wait' for the hubspot, as the value does not exist, the variable is empty.
function getCookieGeneric(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
var prechat_inputs = {};
prechat_inputs["hubspotutk"] = getCookieGeneric('hubspotutk');
var chatbotKey = 'someKEYHere';
(function(d, r, o, z, a, k, t) {
a = d.getElementsByTagName('head')[0];
k = d.createElement('script');
k.async = 1;
t = (Math.floor(Math.random() * 1000000) + 1);
k.src=r + '/' + o + '/droz.js?i=' + z + '&u=' + r + '&v=' + t;
a.appendChild(k);
})(document, 'https://chat-app.meudroz.com', 'v1', chatbotKey);
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.