Skip to main content

Event Types

Complete reference for all available events in the Jarvis Analytics Scheduler.

Core Events

onload()

Fired when the scheduler loads and initializes.

jarvis.onload(() => {
console.log("Scheduler loaded successfully");
});

onNextStep(event)

Fired when moving between booking steps or when booking status changes.

jarvis.onNextStep(event => {
console.log("Step changed:", event);
// Event includes UTM parameters automatically
});

Event Types:

  • scheduling-step - User moves between booking steps
  • scheduling-success - Booking completed successfully
  • scheduling-error - Booking submission failed
  • scheduling-times-nearby - User selects nearby available times

onTimesNearby(event)

Triggered when a timeslot in "Available Times Nearby" is clicked.

jarvis.onTimesNearby(event => {
console.log("Location changed:", event);
});

onBookError(event)

Fired when booking submission fails.

jarvis.onBookError(event => {
console.error("Booking error:", event);
});

Additional Events

onBookSuccess(event)

Fired when booking is completed successfully (separate from onNextStep).

jarvis.onBookSuccess(event => {
console.log("Booking successful:", event);
// Includes: totalBookingTimeInSeconds, location, companyId
});

onOcrScan(event)

Fired when OCR scanning occurs (ID or insurance card scanning).

jarvis.onOcrScan(event => {
console.log("OCR scan completed:", event);
// event.type: 'identification_card' or 'insurance_card'
});

onSubmitted(event)

Fired when the appointment form is submitted.

jarvis.onSubmitted(event => {
console.log("Form submitted:", event);
// Includes: location, companyId
});

Event Payload Structure

Standard Event Payload

{
"event": "scheduling-step",
"locationID": "1881",
"mode": "normal",
"value": 2,
"utm_source": "google",
"utm_campaign": "summer-sale",
"utm_term": "dental cleaning",
"utm_content": "banner-ad"
}

UTM Parameters

All events automatically include UTM parameters when present in the URL:

  • utm_source - Traffic source (automatically set to "rwg" when rwg_token is present)
  • utm_campaign - Campaign name
  • utm_term - Paid search keywords
  • utm_content - Ad content identifier

Success Event Payload

{
"event": "scheduling-success",
"locationID": "1881",
"mode": "normal",
"value": 4,
"totalBookingTimeInSeconds": 120,
"location": {
"name": "Downtown Office",
"location_id": "1881"
},
"companyId": "company_123",
"utm_source": "google",
"utm_campaign": "summer-sale"
}