SaaSMonk Docs
  • 👋Welcome to SaaSMonk
  • Overview
    • 💡What we do
  • 🏗️Setup
    • 🌐Adding the chat widget to your website
    • 📤JavaScript Events
    • 🔗Adding Allowlist URLs
  • 👨‍💼Agent Setup
    • 👉Basic setup
    • Identify individuals clicking on outbound emails
  • 🔌Integrations
    • 📅Calendars
      • Calendly
      • Hubspot
      • RevenueHero Campaign router
      • RevenueHero Inbound Router
    • 💬Slack
      • How to connect?
      • How to use?
    • 🎓SalesForce CRM
    • ⭐HubSpot CRM
  • 🔀Visitor flows
    • Style options
    • Merge tags
    • Opening vs Follow-Up Messages
Powered by GitBook
On this page

Was this helpful?

  1. Setup

JavaScript Events

RevenueHero JavaScript events are sent from the scheduler at different stages. Learn about those events that can be used to trigger downstream activities.

The SaaSMonk Chat Widget tracks and emits the following JavaScript events through the lifecycle of the chat experience. These can be captured using a sample message listener like the following to be used for actions like sending event to Google Analytics, Pixel, etc.

window.addEventListener("message", (ev) => {
  if (ev.data.type == "MEETING_BOOKED") {
    // Send to Google Analytics
    dataLayer.push({ event: "meeting_booked" });

    // Send to pixel
    fbq("track", "RevenueHero", { event: "meeting_booked" });
  }
});

MEETING_BOOKED

The event is sent when a meeting is booked successfully through a calendar integrated within our widget

{
  "type": "MEETING_BOOKED",
  "meeting": {
    "id": "1234",
    "attributes": {
      "booker_name": "John Smith",
      "booker_email": "john.smith@acme.com",
      "phone_number": "+11234567890",
      "booker_company_name": "Acme, Inc",
      "country_code": "US",
      "calendar_type": "calendly",
      "meeting_time": "2023-11-24T05:30:00.000Z",
      "created_at": "2023-11-24T05:30:00.000Z",
      "booking_guests": ["jackie@acme.com"],
      "booked_with_name": "Jane Doe",
      "booked_with_email": "jane@abc.com"
    }
  }
}
PreviousAdding the chat widget to your websiteNextAdding Allowlist URLs

Last updated 1 year ago

Was this helpful?

🏗️
📤