A wrapper to easily swap out different analytics services or to support multiple analytics services at once. Trekker works best with event based analytics services like Mixpanel, Amplitude, Firebase, and Answers by Crashlytics.
Hi, we're Awkward. We used many different analytics services for our iOS reddit client called Beam. We weren't quite sure which service we wanted to use, so we wanted to make it easy to implement them all and switch between services on the fly. Trekker was born. We welcome you to use Trekker for your own projects.
- Event tracking
- Profile tracking
- Timed event tracking (event tracking with duration)
- Event Super Properties
- Push notification registration
- Add Trekker as a submodule to your git project
- Drag
Trekker.xcodeproj
into the project navigator - Go to the project settings and select the settings of the target you want to add Trekker too
- Click plus beneath the
Embedded Binaries
and select theTrekker
framework in the Trekker project - Follow the steps below to add an analytics service (
TrekkerService
)
- Copy all Swift files from the Trekker directory to the project in your navigator
- Follow the steps below to add an analytics service (
TrekkerService
)
TrekkerService is the protocol that is implemented for every analytics service that is fed into Trekker.
Adding a Trekker is simple. First add the framework of the analytics service to your app. There are ready build implementations for some services, see the example services folder.
If the service doesn't have a ready implementation, a new subclass of NSObject should be made. It should implement the TrekkerService protocol. This requires implementing the following properties:
var serviceName: String // The name of the analytics service
var versionString: String // The version of the SDK of the analytics service
Now you can implement the following protocols for the features the analytics service supports:
TrekkerEventAnalytics
for simple event based analyticsTrekkerTimedEventAnalytics
for time event analytics, these events will often have an addedduration
propertyTrekkerPushNotificationAnalytics
for services that allow sending push notification messagesTrekkerUserProfileAnalytics
for services that support user profilesTrekkerEventSuperPropertiesAnalytics
for services that support super properties. Properties that are included with every event.
We're trying to keep our documentation as updated as possible. Here you can find more information on Trekker.
Trekker is available under the MIT license. See the LICENSE file for more info.