Start a new topic

JS | Integrate an analytics tracker with built-in events

You can use Agendize JavaScript events to trigger a third-party tracker (eg: Hubspot) at various steps of the scheduling process. Here is a code snippet providing a list of all event listeners available:


$(window).load(function () {
  WIDGET.addEventListener('staffSelected', function fn1(event, data)
    {console.log("Staff selected");}
  );

  WIDGET.addEventListener('serviceSelected', function fn1(event, data)
    {console.log("Service selected");}
  );

  WIDGET.addEventListener('resourceSelected', function fn1(event, data)
    {console.log("Resource selected");}
  );

  WIDGET.addEventListener('dateSelected', function fn1(event, data)
    {console.log("Date selected");}
  );

  WIDGET.addEventListener('timesDisplayed', function fn1(event, data)
    {console.log("Times displayed");}
  );

  WIDGET.addEventListener('timeSelected', function fn1(event, data)
    {console.log("Time selected");}
  );

  WIDGET.addEventListener('formDisplayed', function fn1(event, data)
    {console.log("Form pre-loaded");
     $('form').submit(function () {
         console.log("Appointment confirmed");
     });
    }
  );
});


Login or Signup to post a comment