BookingNinja includes a comprehensive analytics tracking system that automatically sends booking funnel events to multiple analytics providers including Google Analytics 4 (GA4) and Meta/Facebook Pixel. This system tracks user interactions throughout the booking process to provide insights into conversion rates and user behavior.
Setup: To use the Meta or Google Tracking you will need to place your Analytics tracking ID or Meta Tracking ID inside BookingNinja’s admin panel.
Internal Event Name | GA4 Event | Meta Event | When |
select_guests | select_guests | select_guests | User Has Selected a Guest Count |
select_date | select_date | select_date | A Date Has Been Picked |
select_time | select_time | select_time | The user has picked a time slot |
select_table | select_table | select_table | Only sent when table selection enabled |
view_addons | view_list_item | viewContent | User is on the add-ons page |
add_addon | add_to_cart | AddToCart | User adds an addon |
enter_details | add_shopping_info | add_shopping_info | User has Saved their Contact Details |
start_payment | add_payment_info | AddPaymentInfo | The user is on the payment screen |
booking_completed | purchase | purchase | Booking completed |
Every event includes the following enhanced parameters:
{
timestamp: "2024-01-15T10:30:00.000Z",
page_url: "https://example.com/booking",
page_title: "Book a Table - Restaurant Name",
user_agent: "Mozilla/5.0..."
}
The system automatically maps internal events to GA4 standard events for better reporting and integration with Google's enhanced ecommerce features:
- Purchase events (booking_completed
) map to purchase
- Cart events (add_addon
) map to add_to_cart
- Checkout progression maps to standard GA4 funnel events
The system maps booking events to Facebook's standard events for optimal ad optimization:
- Purchase
for completed bookings
- AddToCart
for add-on selections
- InitiateCheckout
for payment initiation
- ViewContent
for browsing add-ons
When the booking form is embedded in an iframe, events are automatically forwarded to the parent window using postMessage
:
window.addEventListener('message', function(event) {
if (event.data.type === 'analytics_event' &&
event.data.source === 'booking_ninja_iframe') {
// Handle the analytics event
console.log('Booking event:', event.data.event, event.data.parameters);
}
Enable debug mode to see tracking activity in the browser console (this must be on the iFrames window if using the embed)
window.analyticsTracker.enableDebug();
Debug output includes:
- Event names and parameters
- Provider-specific tracking confirmations
- Error messages for failed tracking attempts
- Parent window message sending status