Overview
Event tracking is the foundation of EngageFabric’s gamification system. When players perform actions in your application, you send events to EngageFabric. The Rules Engine then evaluates these events and automatically triggers rewards like XP, currency, quest progress, and badges.How It Works
Tracking Events
Basic Event
Event with Idempotency
Use idempotency keys to prevent duplicate event processing:Common Event Types
Here are recommended event types for different use cases:Learning Platform
E-commerce
Fitness App
Batch Events
Send multiple events in a single request for better performance:Rules Engine Integration
Events are processed by the Rules Engine to trigger automated rewards.Example Rule Configuration
- Triggers on
lesson_completedevents - Checks if
score >= 80 - Awards 100 XP, 25 coins, and progresses a quest
Event Properties
Properties provide context for rule evaluation:| Property Type | Example | Use Case |
|---|---|---|
string | category: "science" | Filter by category |
number | score: 95 | Threshold conditions |
boolean | isPremium: true | User segmentation |
array | tags: ["featured"] | Multiple categorization |
Real-Time Updates
When events trigger rewards, connected clients receive real-time updates via WebSocket:Best Practices
Consistent Naming
Use snake_case for event types:
lesson_completed, purchase_madeRich Properties
Include relevant context in properties for flexible rule creation
Idempotency Keys
Use idempotency keys for important events to prevent duplicates
Batch When Possible
Batch multiple events together to reduce API calls