When to Use Which?
- Use EventTracker
- Use PageTracker (Preferred)
EventTracker should be used only for:
- Standalone events not associated with a page or screen
- Button clicks or interactions not tied to page views
- Background events (app lifecycle, notifications)
- Form submissions without page context
- Lightweight events without engagement tracking needs
Basic Usage
Creating an EventTracker
Tracking an Event
Valid Use Cases
App Lifecycle Events
App Lifecycle Events
Background Events
Background Events
Button Clicks (Not on a Page)
Button Clicks (Not on a Page)
Invalid Use Cases (Use PageTracker Instead)
❌ Don’t: Track Screen Views with EventTracker
✅ Do: Use PageTracker for Screen Views
Event Properties
Events can include structured properties. See Event Properties Guide for complete documentation.Example
Troubleshooting
Events Not Accepted
Problem: Events showing as rejected in logs. Cause: Event schema doesn’t match dashboard configuration. Solution:- Verify event name matches dashboard (case-sensitive)
- Check property names and types match schema
- See Common Errors
Should I Use EventTracker or PageTracker?
Ask yourself:- Is this a page or screen the user is viewing? → Use PageTracker
- Do I need to track engagement time or scroll depth? → Use PageTracker
- Do I want contextual cohorts for this content? → Use PageTracker
- Is this a standalone action/event? → Use EventTracker
Comparison: EventTracker vs PageTracker
| Feature | EventTracker | PageTracker |
|---|---|---|
| Use Case | Standalone events | Page/screen views |
| Engagement Tracking | ❌ No | ✅ Yes (automatic) |
| Scroll Depth | ❌ No | ✅ Yes |
| Contextual Cohorts | ❌ No | ✅ Yes (with URLs) |
| Platform Integration | Basic | ✅ Full integration |
| Lifecycle Management | None | pause/resume/close |
| Insights Quality | Basic | ✅ Rich |
| Recommendation | Specific cases only | Primary method |
Best Practices
- Do
- Don't
- Use EventTracker for truly standalone events
- Use EventTracker for background/system events
- Prefer PageTracker for user-facing content
- Include relevant event properties
- Follow your event schema exactly
Related Documentation
Page Tracking
Recommended primary method
Event Properties
Add structured data to events
Quick Start Guide
Get started with the SDK
Video Tracking
Track video content
Issues
Solve common issues
API Reference
For complete API documentation, see the Javadocs.EventTracker Interface
track(eventName: String)- Track event without propertiestrack(eventName: String, properties: EventProperties?)- Track event with properties
Creating EventTracker
Permutive.eventTracker()- Create an EventTracker instance