Online Chat Integration (LiveChat) on Website
LiveChat is a professional customer support platform with advanced operator features: queues, tags, notes, CRM integration. Popular with mid-sized and large businesses.
Widget Installation
<script>
window.__lc = window.__lc || {};
window.__lc.license = YOUR_LICENSE_NUMBER;
;(function(n,t,c){function i(n){return e._h?e._h.apply(null,n):e._q.push(n)}
var e={_q:[],_h:null,_v:"2.0",on:function(){i(["on",c.call(arguments)])},
once:function(){i(["once",c.call(arguments)])},
off:function(){i(["off",c.call(arguments)])},
get:function(){if(!e._h)throw new Error("[LiveChatWidget] You can't use getters before load.");
return i(["get",c.call(arguments)])},call:function(){i(["call",c.call(arguments)])},
init:function(){var n=t.createElement("script");
n.async=!0,n.type="text/javascript",
n.src="https://cdn.livechatinc.com/tracking.js",t.head.appendChild(n)}};
!n.__lc.asyncInit&&e.init(),n.LiveChatWidget=n.LiveChatWidget||e}(window,document,[].slice))
</script>
JavaScript API
// User identification
LiveChatWidget.call('set_customer_name', user.name);
LiveChatWidget.call('set_customer_email', user.email);
// Custom data (visible to operator)
LiveChatWidget.call('set_session_variables', {
'Order ID': orderId,
'Cart Total': cartTotal + ' ₽',
'User Plan': user.plan
});
// Hide/show
LiveChatWidget.call('hide');
LiveChatWidget.call('minimize');
REST API v3
// Create case via REST API
Http::withBasicAuth('[email protected]', $personalAccessToken)
->post('https://api.livechatinc.com/v3.5/cases', [
'subject' => "Website Inquiry",
'customer' => ['email' => $email, 'name' => $name],
'properties' => [
'source' => ['type' => 'email', 'url' => 'https://shop.com/contact']
]
]);
Webhooks
LiveChat supports webhooks on events: new chat started, chat closed, new message — for logging or CRM integration.
Setup timeframe: a few hours.







