📤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": "[email protected]",
      "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": ["[email protected]"],
      "booked_with_name": "Jane Doe",
      "booked_with_email": "[email protected]"
    }
  }
}

Last updated

Was this helpful?