LiveChat Inc
Setup guide for LiveChat Inc and Ruler Analytics
Integrate LiveChat with Ruler Analytics
This guide explains how to connect your LiveChat widget with Ruler Analytics so that you can track and attribute chat leads directly within your Ruler dashboard.
Step 1 - Load the LiveChat Widget
Before adding your Ruler Analytics cookie, ensure that the LiveChat widget is correctly installed on your website.
If you haven’t yet set up LiveChat, follow the installation guide here LiveChat Setup Guide
Once the LiveChat widget is working correctly on your site, proceed to integrate Ruler Analytics.
Step 2 - Add the Ruler Analytics Integration Script
Add the following JavaScript snippet after your LiveChat tracking code:
<script>
function ruler_live_chat() {
try {
if (RulerAnalyticsVisitorId && LiveChatWidget) {
LiveChatWidget.call('update_session_variables', {
raid: RulerAnalyticsVisitorId,
});
}
} catch (e) {
setTimeout(function() {
ruler_live_chat();
}, 500);
}
}
ruler_live_chat();
</script>
💡 What this does:
- Passes the Ruler Analytics ID (
raid
) into the LiveChat session as a custom variable, allowing Ruler to identify chat leads.
Note: The exact implementation may vary depending on your LiveChat license and installation tag.
Step 3 - Create a Chat Webhook
Once the integration script is active and the Ruler Analytics Visitor ID is being passed through, the next step is to send chat events to Ruler Analytics.
You’ll need to configure a webhook in LiveChat that triggers when a chat session ends.
- Log in to your LiveChat account.
- Create a new App, to allow you to send a webhook.
- Create a new webhook with the
chat_deactivated
trigger. - Use the endpoint URL provided by Ruler Analytics as the webhook destination.
For detailed webhook setup instructions, refer to LiveChat’s documentation here LiveChat Webhooks Guide
Updated about 5 hours ago