Learn to send Webchat events and leads to your CRM or system of record
If you are using Podium Webchat on your business website, you have the ability to capture events from the widget and send them to the place of your choosing. This article assumes that:
- You are currently using Podium Webchat
- You have the technical knowledge to modify your website and write the necessary code you need to send the events
Many businesses operate with a CRM (Marketo, Hubspot, Salesforce) that allows you to track new leads, assign them to salespeople, coordinate where they are in the sales pipeline, etc. With Podium Webchat on your website, it is actively generating leads for you and you can send leads and events to that system.
"Bubble Clicked" - When a customer clicks the widget and it opens "Conversation Started" - When a customer sends a message through Webchat "Widget Closed" - When a customer closes the Widget How do you expose these events? You create a callback function to listen to all Webchat events, as outlined below.
Paste this function in the console of your website, and then interact with the widget on the page. You'll see the events getting printed out with their associated properties.
window.PodiumEventsCallback = function(event, properties) {
console.log(event, properties)
};
Here is an example of how you could use this functionality:
<script>
window.PodiumEventsCallback = function(event, properties) {
var currentUrl = window.location.href;
if (event === 'Bubble Clicked' || event === 'Widget Closed') {
var payload = {
event: 'Podium Webchat ' + event, // can be anything you choose
currentUrl: currentUrl
};
// Send the payload to your service here
}
if (event === 'Conversation Started') {
var payload = {
customerName: properties['customer-name'],
customerPhone: properties['customer-phone'],
customerMessage: properties['customer-message'],
submissionUrl: currentUrl
};
// Send the payload to your service here
}
};
</script>
Please reach out with any other questions regarding this, we're always happy to help.