Doc Status and Source Files
Doc Status and Source Files
Doc Status: Current. Browser events originate from
apps/landing/lib/analytics/analytics.ts. Server events originate from apps/hono/src/services/analytics/posthog-analytics.service.ts.Why This Matters
House of Legends tracks 54 distinct analytics events across browser and server. This page is the single source of truth for what is tracked, where it fires, and which platform receives it.Platform Distribution
| Platform | Events received | Count |
|---|---|---|
| PostHog | All browser + all server | 54 |
| Meta Pixel | Browser events mapped to Meta standard events | 7 |
| Meta CAPI | Server Purchase + forwarded browser events | 4 |
| GTM dataLayer | All browser (dormant — not mounted) | 0 |
Browser Events (46)
Every browser event fires to PostHog. Events marked with Meta also fire to Meta Pixel. Events marked with CAPI are additionally forwarded by Hono to Meta Conversions API.Booking Funnel
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 1 | view_item | ViewContent | — | Viewing a show/experience detail |
| 2 | add_to_cart | AddToCart | — | Adding an experience to the booking cart |
| 3 | remove_from_cart | — | — | Removing an experience from the cart |
| 4 | addons_update | — | — | Adding, removing, or changing addon quantity |
| 5 | view_cart | — | — | Viewing the booking cart summary |
| 6 | booking_step | — | — | Booking funnel step completed or abandoned |
| 7 | begin_checkout | InitiateCheckout | InitiateCheckout | Guest enters payment checkout |
| 8 | add_payment_info | AddPaymentInfo | AddPaymentInfo | Guest submits payment details |
| 9 | purchase | Purchase | — | Server-confirmed paid booking (payment-result page, paymentStatus=PAID) |
| 10 | payment_redirect | — | — | Redirect to/from OnePay payment page |
| 11 | payment_error | — | — | Payment redirect failed, timed out, or abandoned |
| 12 | payment_cta_click | — | — | Pay Now / Contact Support CTA clicked |
Conversion and Leads
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 13 | lead | Lead | Lead | Qualified inquiry submitted |
| 14 | inquiry_start | — | — | Guest opens an inquiry form |
| 15 | form_abandonment | — | — | Guest leaves inquiry form without submitting |
| 16 | form_error | — | — | Validation error on a form field |
| 17 | book_now_click | — | — | Book Now CTA clicked (with source and event context) |
| 18 | promo_applied | — | — | Promo code applied successfully |
| 19 | promo_rejected | — | — | Promo code rejected (invalid or expired) |
| 20 | promo_removed | — | — | Promo code removed from booking |
Engagement
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 21 | page_view | PageView | — | Every page navigation |
| 22 | select_item | — | — | User selects a show/experience from a list |
| 23 | select_content | — | — | User taps a content element |
| 24 | external_link | — | — | User taps an external link |
| 25 | scroll_depth | — | — | User scrolls to a depth threshold |
| 26 | timing | — | — | Performance timing measurement |
| 27 | section_view | — | — | A marked page section becomes visible |
| 28 | section_read | — | — | A marked section viewed for at least 1 second |
| 29 | video_play | — | — | Show page video starts playing |
| 30 | video_complete | — | — | Show page video finishes |
| 31 | homepage_video_play | — | — | Homepage hero video starts playing |
| 32 | homepage_video_complete | — | — | Homepage hero video finishes |
User Interaction
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 33 | customer_support_widget | — | — | Support widget interaction (open, close, phone, WhatsApp, chat) |
| 34 | search | — | — | Search query submitted with results |
| 35 | search_refinement | — | — | Search query refined |
| 36 | empty_search | — | — | Search submitted with no results |
| 37 | language_switch | — | — | User switches locale (en/vi) |
| 38 | mobile_keyboard | — | — | Mobile keyboard opens or closes (with viewport change) |
| 39 | email_subscribe | — | — | User subscribes to email (footer, popup, or booking confirmation) |
| 40 | pdf_download | — | — | User downloads a PDF |
Session and Attribution
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 41 | session_start | — | — | Analytics session begins |
| 42 | session_end | — | — | Analytics session ends |
| 43 | utm_capture | — | — | UTM parameters detected on landing |
Diagnostics
| # | Event | Meta | CAPI | When it fires |
|---|---|---|---|---|
| 44 | $exception | — | — | Uncaught frontend error |
| 45 | api_error | — | — | Network, timeout, server, or client API error |
| 46 | 404 | — | — | Page not found |
Server Events (8)
All server events fire to PostHog from our backend. Thepayment completed event is also sent to Meta CAPI as a server Purchase.
Server Implementation Details
Server Implementation Details
Server events are sent via the
posthog-node SDK from the Hono backend service.| # | Event | Meta CAPI | When it fires |
|---|---|---|---|
| 1 | reservation created | — | New reservation persisted |
| 2 | checkout started | — | Guest enters the payment checkout step |
| 3 | payment completed | Purchase | OnePay confirms a successful payment |
| 4 | payment failed | — | OnePay reports a payment failure |
| 5 | reservation cancelled | — | Reservation status moves to cancelled |
| 6 | refund processed | — | Refund amount recorded against a payment |
| 7 | inquiry submitted | — | New inquiry created from the public form |
| 8 | operator check-in completed | — | Staff checks a guest in through Mission Control |
PostHog Identity and Replay
Beyond events, PostHog also captures:| Feature | Status | Details |
|---|---|---|
| Person identification | Active | CRM customer ID used as distinctId after early lead capture |
| Session replay | Active | Unmasked form inputs and request/response payloads for booking recovery |
| Autocapture | Disabled | Manual event tracking only |
| Page leave | Active | Captured automatically when a visitor navigates away |
Technical Configuration for Autocapture and Page Leave
Technical Configuration for Autocapture and Page Leave
Autocapture is disabled via
NEXT_PUBLIC_POSTHOG_AUTOCAPTURE_ENABLED=false. Page leave capture is enabled via capture_pageleave: true in the PostHog init options.