Case study: Connecting customer identity and hotel-booking behaviour from a production Angular application to Klaviyo for structured customer lifecycle tracking and marketing automation.
Introduction
A hotel booking platform generates valuable customer signals long before a booking is completed.
A traveller may search for a destination, browse available hotels, open a property, save a hotel, select a room, start checkout, and eventually complete a booking. Each step provides different information about customer intent.
The challenge is not simply sending events to Klaviyo.
The challenge is designing an integration that can reliably connect those behaviours to customer profiles, preserve useful context in each event, work correctly while third-party scripts load asynchronously, and keep private API operations on the server.
The solution was a centralized Klaviyo integration through the application’s Angular AnalyticsService.
The implementation captures customer identity and meaningful hotel-booking lifecycle events including destination searches, no-result searches, hotel views, saved hotels, checkout initiation, and booking confirmation.

1. Project Context
The application is a production Angular single-page application supporting a hotel search and booking journey.
The customer lifecycle can be represented as:
Search Destination
↓
Hotel Results
↓
View Hotel
↓
Save Hotel
↓
Select Room
↓
Checkout
↓
Booking Confirmation
This is different from a simple ecommerce storefront.
A traveller can generate meaningful intent without completing a transaction. A search can return no inventory. A hotel can be viewed multiple times. A property can be saved for later. Checkout can be started and abandoned.
That meant the integration needed to capture the journey rather than only the final booking.
2. The Customer Behaviour Problem
2.1 Behaviour happens before booking
The final booking is only one part of the traveller journey.
Searches, hotel views, saved hotels, and checkout activity can all represent different levels of intent.
2.2 No-result searches are meaningful
A search that returns no hotel inventory is not the absence of information.
It tells the platform what the traveller wanted but could not find.
2.3 Customer identity adds context
Behaviour becomes more useful when it can be associated with the appropriate customer profile.
2.4 Different events need different properties
A destination search needs different context from a hotel view or a confirmed booking.
The integration therefore uses event-specific properties rather than sending generic activity notifications.
2.5 Third-party scripts are asynchronous
The Angular application should not need to block normal application behaviour while waiting for the Klaviyo JavaScript library to finish loading.
This required a small integration abstraction between the application and the external tracking library.
3. Designing the Klaviyo Integration
The integration is centralized in the Angular analytics layer.
Angular Hotel Booking Platform
│
▼
AnalyticsService
│
┌─────────┴─────────┐
▼ ▼
Identify Track
│ │
└─────────┬─────────┘
▼
Klaviyo
│
▼
Customer Profiles
│
▼
Marketing Flows
The application features do not need to know the implementation details of the Klaviyo JavaScript integration.
Instead, the analytics service provides application-level methods for:
- identifying customers
- tracking search behaviour
- tracking no-result searches
- tracking hotel views
- tracking saved hotels
- tracking checkout initiation
- tracking booking confirmation
- constructing event properties
- initializing the Klaviyo integration

4. Customer Identification
One of the first requirements is connecting application users with their Klaviyo profile.
The identity flow is:
Authentication State
↓
Customer Profile
↓
AnalyticsService
↓
Klaviyo identify()
↓
Customer Profile
The implementation identifies customers using profile information including:
- first name
- last name
This gives subsequent behavioural events a customer context.
Account creation
The integration also tracks a separate:
Account Created
event.
This distinguishes the creation of an account from later behavioural activity.
5. Tracking Hotel Search Behaviour
The first major behavioural signal is:
Searched Destination
The event contains contextual information including:
- search URL
- search query
- search query parts
- country associated with the search
- image URL
The event represents travel intent rather than merely a UI interaction.
The conceptual flow is:
Traveller
↓
Searches for destination
↓
Hotel Search
↓
AnalyticsService
↓
Searched Destination
↓
Klaviyo
The event can then become part of the customer’s behavioural history.

6. Tracking No-Result Searches
The implementation also records:
No Search Found
This is an important distinction from simply tracking searches.
The event contains information such as:
- destination
- check-in date
- check-out date
- nights
- guests
- occupancy information
- currency
- nationality
The resulting flow is:
Hotel Search
│
├── Results Found
│ ↓
│ Continue Booking Journey
│
└── No Results
↓
No Search Found
↓
Klaviyo
A no-result search represents unmet travel demand.
It provides a useful signal that a traveller was looking for accommodation under a particular set of conditions, even though the platform did not return inventory.
The event can provide a foundation for future customer communication or demand analysis. No specific production marketing flow is claimed here unless independently verified.
7. Tracking Hotel Views
The next important behavioural event is:
Viewed Hotel
The event contains richer accommodation information including:
- URL
- product
- product ID
- image URL
- brand
- categories
- price
- compare-at price
- savings
The journey becomes:
Hotel Results
↓
Traveller opens hotel
↓
Viewed Hotel
↓
AnalyticsService
↓
Klaviyo
This gives the customer profile more context than a generic page-view event.
The tracked event represents the specific accommodation being considered.
8. Tracking Saved Hotels
The application also records:
Hotel Saved
The event includes information such as:
- hotel name
- hotel ID
- categories
- price
- image URL
- link URL
Saving a hotel is a distinct behavioural signal because it represents an explicit action to retain a property for later consideration.
The flow is:
Hotel Viewed
↓
Traveller saves hotel
↓
Hotel Saved
↓
Klaviyo
The event can support future wishlist or price-change communication patterns, but this case study does not claim that a particular automated campaign was created unless verified.
9. Tracking Checkout Started
The booking journey becomes higher intent when the traveller begins checkout.
The integration tracks:
Checkout Started
Relevant properties include:
- booking value
- hotel name
- room type
- nights
- check-in date
- check-out date
- customer locale
- hotel image URL
- link URL
The lifecycle becomes:
Hotel Viewed
↓
Room Selected
↓
Checkout Started
↓
Klaviyo
This event provides a structured representation of pre-booking intent.
It also creates a useful boundary between browsing behaviour and transaction behaviour.
10. Tracking Booking Confirmation
The final major lifecycle event is:
Booking Confirmed
The event contains information including:
- booking value
- hotel name
- destination
- check-in date
- check-out date
- booking reference
- transaction ID
- customer locale
- hotel image URL
- link URL
The complete customer journey can therefore be represented as:
Search
↓
Hotel Viewed
↓
Hotel Saved
↓
Checkout Started
↓
Booking Confirmed
Each stage carries different information and represents a different level of customer intent.

11. Event Property Design
Event names explain what happened.
Event properties explain the context in which it happened.
For example:
Viewed Hotel
is more useful when accompanied by information identifying the hotel, its URL, image, category, and price.
Likewise:
Booking Confirmed
becomes substantially more useful when it includes booking value, destination, stay dates, booking reference, and transaction ID.
The implementation therefore uses event-specific property structures rather than attempting to fit every customer action into one generic schema.
Event catalogue
| Event | Purpose |
|---|---|
identify |
Associate the customer with a Klaviyo profile |
Account Created |
Represent account creation |
Searched Destination |
Capture hotel search intent |
No Search Found |
Capture searches where no inventory was returned |
Viewed Hotel |
Capture hotel browsing behaviour |
Hotel Saved |
Capture explicit saved-hotel behaviour |
Checkout Started |
Capture high-intent checkout activity |
Booking Confirmed |
Capture completed booking behaviour |
This structure makes the customer lifecycle explicit.
12. Dynamic Klaviyo Proxy Loading
The application loads Klaviyo tracking dynamically.
A JavaScript proxy/queue is initialized so that Angular code can invoke Klaviyo operations while the remote tracking script is still loading.
Conceptually:
Angular Application
↓
AnalyticsService
↓
Klaviyo Proxy
↓
identify() / track()
↓
Queue when necessary
↓
Klaviyo Script Loads
↓
Operations Continue
This creates an abstraction between the application and the external JavaScript library.
Instead of every feature checking whether Klaviyo has finished loading, the analytics layer manages that concern centrally.
The implementation also uses duplicate-script protection so that the same external tracking script is not blindly injected multiple times.

13. Server-Side Newsletter Subscription
Not every Klaviyo operation belongs in browser-side tracking.
The application also has a server-side newsletter subscription flow:
Angular Application
↓
Backend API
↓
Klaviyo List Subscription
The frontend calls a backend endpoint for the subscription operation.
This creates an important security boundary because private Klaviyo API credentials remain on the server rather than being exposed in browser code.
Why separate the responsibilities?
Browser-side tracking is primarily concerned with behavioural events and customer interaction.
Server-side operations can safely handle actions that require private API credentials.
The architecture therefore separates:
Client-side Behaviour Tracking
from:
Server-side Private API Operations

14. Relationship With the Broader Analytics Architecture
Klaviyo is one destination within the application’s broader centralized analytics architecture.
Conceptually:
Angular Application
│
▼
AnalyticsService
│
┌──────────────┼──────────────┐
▼ ▼ ▼
GTM Klaviyo Clarity
│ │
▼ ▼
GA4 Customer / Marketing
Behaviour
The value of this pattern is that application features do not need to become tightly coupled to each analytics platform.
The hotel-search feature can report that a meaningful search occurred. The analytics layer determines how that event is represented for the relevant destination.
The same principle applies to hotel views, checkout, and booking confirmation.
Related case study
Engineering Reliable Analytics Tracking in an Angular Hotel Booking Platform
15. Challenges & Engineering Decisions
Centralize the integration
Klaviyo-specific implementation is kept behind the analytics service rather than scattered across application components.
Track the customer lifecycle
The integration captures meaningful stages from hotel search through booking rather than focusing only on completed transactions.
Use rich event properties
Each event carries the context required to understand the customer’s action.
Handle asynchronous third-party loading
A proxy/queue abstraction allows application code to work without directly depending on the timing of external script initialization.
Keep private API operations server-side
Newsletter subscription is routed through the backend so private Klaviyo credentials do not need to be exposed in the browser.
16. What This Architecture Provides
The implementation provides:
- Consistent customer identification
- Structured hotel-search behaviour tracking
- Visibility into no-result searches
- Hotel browsing intent signals
- Saved-hotel behaviour tracking
- Checkout intent tracking
- Booking lifecycle tracking
- Rich event context
- Centralized Klaviyo integration logic
- A safer boundary for private Klaviyo API operations
These capabilities provide a foundation for customer lifecycle analysis and marketing automation.
No specific revenue, conversion, campaign-performance, or ROI improvement is claimed because verified production metrics were not available as part of this implementation review.
17. Lessons Learned
Customer behaviour starts before the transaction
For hotel booking, the search itself can be an important customer-intent signal.
Failed searches are still valuable events
A no-result search can reveal demand that the platform was unable to satisfy.
Event schemas should reflect the domain
Hotel booking events need hotel, room, stay, and booking context rather than generic ecommerce properties alone.
Analytics integrations benefit from an abstraction layer
A centralized service prevents individual Angular components from becoming tightly coupled to external analytics platforms.
Browser and server responsibilities should remain clear
Client-side behavioural tracking and server-side operations requiring private credentials should be handled through appropriate boundaries.
18. Conclusion
Integrating Klaviyo into a hotel booking platform is more than loading a tracking script and sending a booking event.
The valuable part is building a customer behaviour model around the actual traveller journey.
The centralized Angular analytics layer connects customer identity with meaningful events across hotel search, no-result searches, hotel views, saved hotels, checkout, and booking confirmation.
A dynamic proxy/queue handles asynchronous Klaviyo initialization, while server-side subscription operations keep private API credentials outside the browser.
The result is a structured customer-event architecture that can support both behavioural analysis and marketing automation without coupling hotel-booking components directly to Klaviyo.
Related Content
GTM / GA4 Analytics Case Study
Engineering Reliable Analytics Tracking in an Angular Hotel Booking Platform
Supporting Technical Article
Tracking Customer Behaviour in an Angular SPA with Klaviyo (Coming soon)
Similar case studies
Engineering Reliable Analytics Tracking in an Angular Hotel Booking Platform
Learn how a centralized analytics architecture using Google Tag Manager and GA4 improved ecommerce event reliability across a hotel search and booking journey.
Enterprise Angular Application Modernization | Rajdip Khavad
Learn how an enterprise application was upgraded from Angular 11 to Angular 17/18, migrating to Standalone Components and Signals.
About Rajdip Khavad
Rajdip Khavad is an Angular and ASP.NET Core/.NET developer specializing in enterprise applications, APIs, application modernization and performance-focused engineering. On this project, his focus was centralized Klaviyo integration, customer lifecycle event modeling and secure server-side subscription workflows.
