Skip to content

Instantly share code, notes, and snippets.

@jakehasler
Created May 20, 2019 18:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakehasler/dfbe504ce895d2dba3242c47b51c9ac3 to your computer and use it in GitHub Desktop.
Save jakehasler/dfbe504ce895d2dba3242c47b51c9ac3 to your computer and use it in GitHub Desktop.
Capturing Podium Webchat Events

How to Capture Podium Webchat Events on Your Website

Learn to send Webchat events and leads to your CRM or system of record

What is this?

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

How can it help you?

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.

What events are available?

"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)
};

How do I use this?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment