Tawk Live Chat

Tawk.to is a live chat tool that can be integrated to your website.

In order to collect conversions from Tawk Live chat we need to:

  • Create a custom attribute in Tawk
  • On your website, add the a user's Ruler cookie to the Tawk chat widget
  • Establish an API connection between Ruler and Tawk
  • Set up a webhook to send chats from Tawk to Ruler

Ruler can collect information from Tawk live chat tool and use it to create a conversion in Ruler Analytics.

Creating custom attribute in Tawk

Navigate to the 'Contacts' section of your Tawk dashboard and click 'Attributes' in the lower left corner.

From there, click 'Add Attribute' to create a new custom attribute. You should call this custom attribute raid and set the format as text.

On your website, add the user's Ruler cookie to the Tawk chat widget

Add this script to all pages on the website where Tawk widget is published.

<script> (function addRulerIdToTawkChat(attempt = 0) { const maxRetries = 5; const retryDelay = 1000; try { if (typeof RulerAnalyticsVisitorId === "undefined") { if (attempt < maxRetries) { setTimeout(() => addRulerIdToTawkChat(attempt + 1), retryDelay); } return; } if (typeof window.Tawk_API === "undefined") { return; } window.Tawk_API.onLoad = function () { window.Tawk_API.setAttributes( { raid: RulerAnalyticsVisitorId }, function (error) {} ); }; } catch (error) {} })(); </script>

This script is designed to add the RulerAnalyticsVisitorId variable as a custom attribute on the visitor's Tawk contact record.

You should be able to test this by creating a new chat on the website before checking your contact record and seeing if the raid custom attribute has been populated.

📘

Are you collecting additional visitor information via Tawk?

Collecting the RulerAnalyticsVisitorId from your website allows Ruler to link a Tawk chat back to a visitor session. However, the RulerAnalyticsVisitorId may not be enough to link data from another data source like your CRM.

You may need to collect another visitor identifier like an email address a [Tawk Pre Chat Form](> 📘 https://www.tawk.to/academy/pre-chat-form/).

Establish an API connection between Tawk and Ruler

Use the Tawk API documentation to find your API key and share it with your Ruler onboarding manager. Your onboarding manager will set up the API connection between Tawk and Ruler.

For more information contact support@ruleranalytics.com.

Set up a webhook to send chats from Tawk to Ruler

Use the Tawk API documentation to create a new webhook configured on the 'Chat End' event. Your onboarding manager will provide you with a URL address to send the webhook to.

For more information contact support@ruleranalytics.com.