Welcome to egistat
egistat is a powerful analytics platform that helps developers track user behavior, optimize performance, and make data-driven decisions.
Installation
Install egistat with your package manager of choice:
npm install egistat # or with yarn yarn add egistat
Getting Started
1. Initialize egistat
const egistat = require('egistat'); egistat.init({ token: 'your-token-goes-here' });
2. Track Events
Use the simple API to track user interactions
egistat.track('button_click', { element: '#submit-button', page: 'checkout' });
API Reference
track(eventName, data)
Tracks custom events with optional metadata
track(eventName: string, options: { element?: string, page?: string, user_id?: string, [key: string]: any })
Best Practices
Event Naming
Use clear, consistent naming patterns like "purchase_complete" and "cart_view" for easier analysis.
Performance
Debounce frequent events like scroll tracking to avoid overwhelming your analytics.
Data Privacy
Always anonymize user data when tracking behavior analytics.