Back to Developers
Libraries
SDKs & Libraries
Official client libraries to integrate with GuestMaker. All SDKs provide a consistent, idiomatic experience for each language.
Fast Integration
Get started quickly with pre-built methods for all API endpoints.
Type Safety
Full type definitions for compile-time safety and IDE autocompletion.
Built-in Retries
Automatic retry logic with exponential backoff for reliability.
GuestMaker.js Tracking SDK
guestmaker.jsAvailable
Installation
<script src="https://guestmaker.ai/sdk/guestmaker.js"></script>Features
- Anonymous visitor tracking with persistent visitor ID (13-month cookie)
- Automatic page view, scroll depth, click, and form tracking
- Session management with configurable timeout (default 30 min)
- UTM parameter capture and campaign attribution
- Visitor identification — link anonymous visitors to email/phone
- Event batching with 5-second flush interval or 20-event threshold
- Privacy-first: respects Global Privacy Control (GPC) signal
- Unified SDK: includes Loyalty and Conversion modules
Example Usage
// 1. Initialize the SDK
GuestMaker.init({
apiKey: 'gmkr_your_api_key',
tenantSlug: 'your-hotel-group',
modules: { tracking: true, loyalty: true }
});
// 2. Automatic tracking starts immediately
// Page views, scroll depth, clicks, and forms are tracked automatically
// 3. Identify a visitor (e.g., after newsletter signup or booking)
GuestMaker.identify({
email: 'guest@example.com',
name: 'John Doe',
source: 'newsletter_signup'
});
// 4. Track custom events
GuestMaker.track('booking_started', {
room_type: 'Deluxe Suite',
check_in: '2026-03-15'
});
// 5. Access loyalty module (if enabled)
const member = await GuestMaker.loyalty.checkMember('guest@example.com');
if (!member) {
await GuestMaker.loyalty.enrollMember({
email: 'guest@example.com',
first_name: 'John'
});
}
// 6. Get the anonymous visitor ID (for server-side use)
const visitorId = GuestMaker.getVisitorId();