Skip to main content

Google Tag Manager Integration

Integrate Practice Growth Suite events with Google Tag Manager for comprehensive event tracking and analytics.

Overview

Google Tag Manager enables you to track all Jarvis events without code modifications, providing insights into user behavior and booking funnel performance.

Event Types & Data Layer

Core Events

Jarvis fires these events that can be captured in GTM:

scheduling-step

Triggered when users move between booking steps.

Data Layer Variables:

  • jarvis_event_type: scheduling-step
  • jarvis_step_number: Current step number
  • jarvis_location_id: Selected location ID
  • jarvis_mode: Booking mode (normal, same-day, etc.)

scheduling-success

Triggered when booking is completed successfully.

Data Layer Variables:

  • jarvis_event_type: scheduling-success
  • jarvis_service_name: Selected service name
  • jarvis_service_id: Selected service ID
  • jarvis_appointment_date: Scheduled appointment date
  • jarvis_location_id: Booking location ID

scheduling-error

Triggered when booking submission fails.

Data Layer Variables:

  • jarvis_event_type: scheduling-error
  • jarvis_error_message: Error description
  • jarvis_step_number: Step where error occurred

scheduling-times-nearby

Triggered when users click on "Available Times Nearby" options.

Data Layer Variables:

  • jarvis_event_type: scheduling-times-nearby
  • jarvis_from_location: Original location
  • jarvis_to_location: Nearby location selected

GTM Configuration

1. Create Custom Events

Set up triggers for each Jarvis event type:

// GTM Trigger Configuration
// Event Name: jarvis_event
// Trigger Type: Custom Event
// Event Name: scheduling-step, scheduling-success, scheduling-error, scheduling-times-nearby

2. Data Layer Variables

Configure these variables in GTM to capture event data:

Variable NameData Layer KeyDescription
jarvis_event_typejarvis_event_typeType of event fired
jarvis_step_numberjarvis_step_numberCurrent booking step
jarvis_location_idjarvis_location_idSelected location ID
jarvis_modejarvis_modeBooking mode
jarvis_service_namejarvis_service_nameSelected service name
jarvis_service_idjarvis_service_idSelected service ID
jarvis_appointment_datejarvis_appointment_dateScheduled date
jarvis_error_messagejarvis_error_messageError details

3. Event Tracking Setup

// Example: Track all Jarvis events
jarvis.onNextStep((event) => {
window.dataLayer.push({
'event': 'jarvis_event',
'jarvis_event_type': event.event,
'jarvis_step_number': event.value,
'jarvis_location_id': event.locationID,
'jarvis_mode': event.mode
});
});

jarvis.onTimesNearby((event) => {
window.dataLayer.push({
'event': 'jarvis_event',
'jarvis_event_type': 'scheduling-times-nearby',
'jarvis_from_location': event.fromLocation,
'jarvis_to_location': event.toLocation
});
});

jarvis.onBookError((event) => {
window.dataLayer.push({
'event': 'jarvis_event',
'jarvis_event_type': 'scheduling-error',
'jarvis_error_message': event.message,
'jarvis_step_number': event.step
});
});

Analytics Integration

Google Analytics 4

Track Jarvis events as custom events:

// GA4 Event Configuration
// Event Name: jarvis_booking_step
// Parameters: step_number, location_id, mode

// Event Name: jarvis_booking_success
// Parameters: service_name, service_id, appointment_date

// Event Name: jarvis_booking_error
// Parameters: error_message, step_number

Conversion Tracking

Set up conversion tracking for key events:

  • Goal Completion: scheduling-success events
  • Funnel Analysis: Track scheduling-step progression
  • Error Monitoring: Monitor scheduling-error frequency

Event Monitoring

Real-time Dashboard

Monitor events in real-time using GTM's preview mode:

  1. Enable GTM Preview mode
  2. Navigate through Jarvis booking flow
  3. Verify events are firing correctly
  4. Check data layer variables are populated

Common Issues

  • Events not firing: Verify Jarvis event listeners are attached
  • Missing data: Check data layer variable configuration
  • Duplicate events: Ensure single event listener attachment

Next Steps