How to Extract Analytics Data from Your iOS Application
Article Summary
Arsen Gasparyan from Revolut breaks down how to build an analytics system that's actually testable. Most teams bolt on tracking as an afterthought—here's the protocol-oriented approach that scales.
Revolut's iOS team needed a way to track user behavior across multiple analytics platforms (Google Analytics and Amplitude) without creating a maintenance nightmare. This article walks through their Swift implementation using protocols and enums to create a flexible, testable analytics layer.
Key Takeaways
- Protocol-based architecture lets you swap analytics providers without touching business logic
- Enum with associated values maps events to identifiers and properties cleanly
- Dummy provider pattern enables unit testing of analytics without real API calls
- Single client forwards events to multiple platforms simultaneously
- Setup happens once in didFinishLaunchingWithOptions, then track anywhere
Critical Insight
A protocol-oriented analytics wrapper gives you multi-platform tracking, full test coverage, and zero vendor lock-in.