If you are new to Countly this the perfect place to start your SDK journey. Follow through this document to choose and setup an SDK and start sending data to your server.
Select an SDK
Countly provides various functionalities through different SDKs targeted for mobile, web, desktop, and server-to-server use cases. You should start by selecting an SDK that fits your goals first:
| SDK | Journeys | Analytics |
Push Notifications |
User Profiles |
Crash Reports |
A/B Testing |
Feedback widgets |
|---|---|---|---|---|---|---|---|
| Swift | ● | ● | ● | ● | ● | ● | ● |
| iOS | ● | ● | ● | ● | ● | ● | ● |
| Android | ● | ● | ● | ● | ● | ● | ● |
| Web | ● | ● | ● | ● | ● | ● | ● |
| Node.js | - | ● | - | ● | ● | ● | - |
| React Native | ● | ● | ● | ● | ● | ● | ● |
| Flutter | ● | ● | ● | ● | ● | ● | ● |
| Windows | ● | ● | - | ● | ● | ● | ● |
| C++ | - | ● | - | ● | ● | ● | ● |
| Unity | ● | ● | ● | ● | ● | ● | ● |
| Java | - | ● | - | ● | ● | ● | ● |
| GTM | ● | ● | - | ● | ● | ● | ● |
Dart |
● |
● |
- |
● |
● |
● |
● |
HarmonyOS |
● |
● |
● |
● |
● |
● |
● |
Choosing Between the Swift and iOS SDKs
For Apple platforms, Countly has two SDKs: the Swift SDK and the iOS SDK. Both support iOS and iPadOS 15, tvOS 15, watchOS 9, macOS 12, and visionOS 1, and both can be called from Swift and Objective-C. Pick the one that fits your app:
| Swift SDK | iOS SDK | |
|---|---|---|
| Written in | Swift, with an Objective-C interface | Objective-C, callable from Swift |
| Install with | Swift Package Manager | Swift Package Manager, CocoaPods, Carthage, or the source files |
| Only in this SDK | An API grouped by feature, a SwiftUI modifier for view tracking, several instances in one app, and a request queue kept in SQLite, so a crash or a forced quit loses nothing | Application Performance Monitoring, and crash reporting through PLCrashReporter |
| Best for | New apps, apps built with Swift or SwiftUI, and apps that send data to more than one app key or server | Apps that already use it, that need Application Performance Monitoring or PLCrashReporter, or that install with CocoaPods or Carthage |
Moving from the iOS SDK to the Swift SDK keeps the device ID, the cached remote config, and the queued requests. See Moving from the iOS SDK.
Building with Flutter or React Native? Use that framework's SDK, which includes the iOS SDK.
Acquiring Your Application Key and Server URL
For using an SDK you will need your Countly server URL and the app key of the Countly app you want to send data to:
Acquiring the Application Key
Also referred to as 'appKey' or 'app_key' as shorthand, the application key is used to identify the application for which the information will be gathered by the SDK. You receive this value by creating a new application in Countly and accessing it on its application management screen.
Note: Ensure you are using the App Key (found under Management -> Applications) and not the API Key. Entering the API Key will not work.
Acquiring the Server URL
This is the domain from which you are accessing your Countly server. During your SDK initialization, you'll see a config parameter called 'url', 'server url,' or a similar value that you need to fill in while configuring the SDK. You have to fill that value with the IP or hostname of your server. For example, if you have Countly installed on 192.168.1.1, then inside the SDK, you will need to write https://192.168.1.1 , if the SSL configuration is complete, or http://192.168.1.1 if there is no SSL configuration. If there is a server name associated with your IP, that server name may also be used instead (e.g. https://countly.mycompany.com).
Integrate an SDK
After deciding on which SDK to use and acquiring your app key, now you should continue with a basic integration to make further implementation as smooth as possible. Quick access documentation is perfect for this task:
Verify SDK-Server Connection
After integrating an SDK into your project, when you open your application or visit your website you should start seeing data flow into your server. If you experience any problems at this step you can check out our Validation FAQ:
Integration Strategy
Is it better to create a unique event for each user action or a universal event will be better? How to track multiple users on a single device? To answer these and many more implementation questions like these we have an integration strategy guide to help you design your tracking strategy:
Feel Free to Reach Out
Do not forget to reach us out when you are in need. You can open a ticket if you are an Enterprise customer and for Countly Lite users (and for all Countliers) we have our Discord channel: