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-stepjarvis_step_number: Current step numberjarvis_location_id: Selected location IDjarvis_mode: Booking mode (normal, same-day, etc.)
scheduling-success
Triggered when booking is completed successfully.
Data Layer Variables:
jarvis_event_type:scheduling-successjarvis_service_name: Selected service namejarvis_service_id: Selected service IDjarvis_appointment_date: Scheduled appointment datejarvis_location_id: Booking location ID
scheduling-error
Triggered when booking submission fails.
Data Layer Variables:
jarvis_event_type:scheduling-errorjarvis_error_message: Error descriptionjarvis_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-nearbyjarvis_from_location: Original locationjarvis_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 Name | Data Layer Key | Description |
|---|---|---|
jarvis_event_type | jarvis_event_type | Type of event fired |
jarvis_step_number | jarvis_step_number | Current booking step |
jarvis_location_id | jarvis_location_id | Selected location ID |
jarvis_mode | jarvis_mode | Booking mode |
jarvis_service_name | jarvis_service_name | Selected service name |
jarvis_service_id | jarvis_service_id | Selected service ID |
jarvis_appointment_date | jarvis_appointment_date | Scheduled date |
jarvis_error_message | jarvis_error_message | Error 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-successevents - Funnel Analysis: Track
scheduling-stepprogression - Error Monitoring: Monitor
scheduling-errorfrequency
Event Monitoring
Real-time Dashboard
Monitor events in real-time using GTM's preview mode:
- Enable GTM Preview mode
- Navigate through Jarvis booking flow
- Verify events are firing correctly
- 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
- Event Types - Complete event reference
- UTM Parameters - Track marketing campaigns