Features
Analytics
Analytics are crucial for understanding user behavior, improving the user experience, and making informed decisions about app development. ShipThatApp
uses TelemetryClient
(referred to as TelemetryDeck
in the actual client documentation) for analytics purposes. Here is how it’s set up and used in the boilerplate:
TelemetryDeck Integration
TelemetryDeck is a privacy-focused analytics service that allows you to capture data without compromising user confidentiality. It is preconfigured in the ShipThatApp
boilerplate to start sending analytics data as early as the splash screen dismissal.
Configuration
To configure TelemetryDeck
analytics, the following steps are necessary:
Steps
- Obtain the TelemetryDeck App ID from the TelemetryDeck dashboard.
- Add your App ID to the
Info.plist
:
<key>TD_APP_ID</key>
<string>Your_TelemetryDeck_App_ID</string>
- Initialize TelemetryDeck in the
configureTelemetry()
within your app's entry file, typicallyShipThatAppApp.swift
:
private func configureTelemetry() {
guard let telemetryDeckAppID = Bundle.main.infoDictionary?["TD_APP_ID"] as? String else { return }
let configuration = TelemetryManagerConfiguration(appID: telemetryDeckAppID)
TelemetryManager.initialize(with: configuration)
}
- On app launch, call the
configureTelemetry()
inside theinit()
ofShipThatAppApp
.
Sending Events
To send an event to TelemetryDeck, the TelemetryManager
is used. Events can represent any user action or significant lifecycle event you want to track with an optional set of properties.
Example
// Sending a simple event
TelemetryManager.send("AppLaunched")
// Sending an event with properties
TelemetryManager.send("PurchaseAttempt", with: ["productID": "prod123", "price": "9.99"])
These events need to be thoughtfully placed throughout the app where tracking is desired:
- User interactions such as button taps or feature uses.
- System events like app backgrounding, foregrounding, or errors.
- Completion of processes, like in-app purchases or user sign-in.
Security and Privacy Compliance
With TelemetryDeck, user privacy is highly respected, and the client does not require user permission to track analytics since it’s designed not to collect personally identifiable information or IP addresses. However, always make sure to comply with local privacy laws and inform users about data collection practices in your privacy policy.
Visualizing Data
TelemetryDeck provides a dashboard where you can create various charts and insights from the tracked data. You can visualize user engagement, retention, conversion, and many other metrics through the console.
Customization
TelemetryDeck is highly customizable. Developers can:
- Define custom events that match specific behaviors within the app.
- Segment users based on their actions and use this information to target specific user groups or analyze behaviors.
Testing & Debugging
TelemetryDeck allows the configuration of a debug identifier for development devices. This ensures that analytics data from development and testing does not pollute the production data:
if isDebug {
TelemetryManager.setDebugIdentifier("Developer_iPhone")
}
Please note that the debug identifier should always be conditionally included and never sent with production analytics.
Conclusion
By using TelemetryDeck
within ShipThatApp
, developers can gain valuable insights while respecting user privacy. The setup process is straightforward, and with events sent at strategic points in the app, a comprehensive view of how users engage with the application can be obtained and utilized for future development and enhancements.