Countly Mobile Analytics | Blog

Aug 14

Guest post: How I give back to open source community by improving Android SDK

imageEditor’s note: Guest blogger Jason Boehle is Android developer in Coupons, Inc.

He uses open source in his work and occasionally contributes to open source projects. 

It’s been more than 5 years since I became the first mobile developer at, after they acquired my app Grocery iQ.  Since then, we’ve built a great mobile engineering team and used many open source projects in our apps.  Until recently though, we used a homegrown analytics solution, mostly due to data privacy concerns with hosted analytics providers.  Around the start of 2014, we discovered Countly. With it being open source and able to be self-hosted, we found a possible successor to our internal analytics tool.  Fast forward to the end of March, we made our Android app the first Countly test subject and rolled it out to production.  For the initial roll out, we did not use custom events; those were added over the next few months as we integrated Countly into the rest of our mobile apps and expanded to over 50 custom events. We love the slick Countly UI, real-time dashboard, and easy SDK integration


Open source software often makes our lives as developers much easier.  When you consider how much development time can be saved by making use of ready-made open source components, it should be easy to justify spending some time giving back to the community.  However, due to the frantic pace at which our industry moves, that is often not the case.  My team has spent a lot of time over the past two years optimizing our efficiency, so recently we have been keeping an eye out for an opportunity to give back to the open source community.

Given our newfound reliance on Countly, I decided to take a look at their open source SDKs.  I checked out the latest Countly Android SDK from Github and started exploring.  After taking the time to understand the code, I saw several opportunities for improvement.  Like most code bases, the SDK was in need of comprehensive unit tests, documentation, and more robust error handling.  


I spent some time in late June working to improve the Countly Android SDK.  First I broke out the classes contained in to a single class per source file to make it easier to comprehend and maintain.  In parallel to improving the existing code and fixing a few bugs discovered along the way, I wrote unit tests for every class in the SDK.  I also added JavaDoc and code comments to help out new SDK users & future open source contributors.  After committing all of these improvements to my Github fork, I submitted some tickets to the master Countly Android SDK project to cover the improvements I had made. 

Later the Countly team contacted me to go over the tickets I had filed.  They were excited to learn about the improvements I had made to the Android SDK.  Since so many changes had been made to the code, we agreed that I didn’t need to submit a bunch of pull requests.  Instead, they would review and manually incorporate my changes.  After merging my work into a new branch with some minor changes, I updated a few unit tests and fixed a bug (that the unit tests caught!), and now the Countly team is preparing to release an official update to the SDK.

The major improvements made in the new Android SDK release are:

 - Comprehensive unit tests & documentation

 - More robust error handling and parameter checking

 - Ability to supply custom device identifier instead of using OpenUDID

 - Countly API is now thread safe

I am very excited about the improvements in this release and I can’t wait for it to be available to all Countly Android SDK users.

I hope that my experience encourages others to contribute to open source.  The Countly team was easy to work with, accepting of my changes, and appreciative of my work.  I’d like to give special thanks to Artem Salpagarov for reviewing and merging my code. I enjoyed working on the SDK and look forward to further collaboration with the Countly team.  For those developers out there making use of open source, don’t be afraid to jump in head first and give back to the community!

Aug 10

Use Countly with Swift

Editor’s note: Guest blogger Anthony Da Mota is a French IT student at IT Paris-Eiffel, currently living in Paris. In addition to his studies, he gives trainings at as a PHP developer since November 2013.

Countly is a fully open source and community-based project that allows developers to track their mobile and desktop application user’s actions. The best thing is that Countly is open source and thus allows developers to get their own Countly dedicated server, so you will no longer have to depend from an external service, even if Countly Coud is really great.

I found Countly by chance while I was browsing for some Swift projects, and as I found this project interesting, I took a deeper look on this project. The documentation explains well how to install the SDK on an Objective-C application, but nothing to get started with Swift.

So let’s begin !

1. What you need

2. Setup and configuration



#import “Countly.h”


Modify the file AppDelegate.swift and insert this code which I commented to know what it does:

// Declaring the myCountly constant:
let myCountly = Countly.sharedInstance()

// Then choose one of the two following options :

// If you use Countly Cloud:
myCountly.startOnCloudWithAppKey(“YOUR_APP_KEY”) // Line to modify

// —> OR

// Declaring the myCountly constant:
let myCountly = Countly.sharedInstance()

// Then choose one of the two following options :

// If you use Countly Cloud :
myCountly.startOnCloudWithAppKey(“YOUR_APP_KEY”) // Line to modify

// —> OR

3. How to use events with Swift

- Event key and count 

myCountly.recordEvent(“My event”, count: 1)

- Event key, count and sum :

myCountly.recordEvent(“My event”, count: 1, sum: 2.5)

- Event key and count with segmentation(s) :

- Event key, count and sum with segmentation(s) :

var user_infos = [“Country”: “France”, “City”: “Paris”, “Department”: “75”]
myCountly.recordEvent(“My event”, segmentation: user_infos, count: 1, sum: 2.5)

So, that’s it. You correctly set up your Swift application to work with Countly ! If you are too lazy to read, I made a little video on how to use Countly with Swift.

— Anthony Da Mota

Jul 30

On Yahoo’s acquisition of Flurry and data privacy

imageYahoo has acquired Flurry for (reportedly) over USD 300M. With this buyout, Yahoo plans to go deeper into the mobile analytics and and acquisition domain, hoping to be a mobile-first company and compete with Facebook, Google and other companies having the most share from a multi-billion ad industry.

Flurry, at the cost of providing free analytics service, not only collects data about your application, but also combines this information and uses it. According to Flurry Terms of Service, Flurry owns and retains all right, title and interest in reports and all other results & data provided to you through their service.

While this may seem to be acceptable to most small companies and SMEs, many corporates, financial institutions, insurance companies do have strict regulations to keep their company data on-premise. This is not a coincidence - throughout the history of computing, we have seen many cases where companies illegally exploiting information gained through collecting data from customers.

This is where Countly stands out: It’s your data, your policy and your rules to use this data. We do not combine collected data with other customer information and share it with 3rd parties. We do not have mechanisms to share user IDs across applications or services. Countly, with its open infrastructure, is world’s first and most extensive open source enterprise mobile analytics platform with no intentions to exploit collected data. 

We’ll witness many acquisitions in analytics space in upcoming months by giants, and data privacy will be more important than ever, especially for companies generating, collecting and storing personally identifiable information and private mobile data.

Contact us for more information about Countly mobile analytics and Countly Enterprise Edition you can install on-premise.

Your privacy matters to us.

— Countly Team

Jun 21

On radar: Smart TV analytics


While developing Countly, we wanted to make sure that analytics should be fun and accessible by everyone. This is why we initially decided to open source our codebase and put a of effort on user interface design. Another small but unknown dedication towards making Countly was building a system for every types of analytics, from mobile to desktop, from Internet of Things to Smart TVs. I think we’ve come a long way to establish our dreams as we have seen several parties benefit from Countly in extraordinary ways.

Smart TV analytics is no exception to this scenario. If you are a smart TV builder, you do not particularly need a dedicated & costly solution (if there are any), and better benefit from a generic analytics platform that support custom events. In this case, you can collect, view and analyze metrics in a given time period, such as:

These performance metrics (Smart TV Intelligence or data collected from multi-screen devices) can all be viewed either on Countly main dashboard, or as a custom event. Countly Drill and Countly Funnel will also help during deep-analysing of collected data and drill-down on user events. This way, several questions starting with how’s and why’s can easily be answered.

Several countries have regulations on collecting user data, including children, and it can be very dangerous and regulatively prohibited to store personally identifiable information in a 3rd party company server. Countly Enterprise Edition is a perfect fit as it can be installed on-premise, prodiving higher security and privacy as user data gets collected. It simply sits on TV operator premises, preferably exchanging data with operator’s backend.

Using Countly Enterprise will also provide scalability for Smart TV analytics to operator as it will be possible to answer growing demands and increasing number of devices.

May 05

Is your mobile application data secure and safe?


Building mobile products takes quite a lot of time and effort. Not only do you need domain expertise in areas like mobile application development, usability, cross platform development, working with different screen sizes and resolutions, and more … you need to make sure that you deliver a quality product that works as intended and gracefully handles unexpected errors.

Not only do you need to worry about your own code, but you also need to be concerned about any 3rd party code and SDKs you may be using.  An SDK is injected directly into your app and how it works directly will impact your application. So when an SDK crashes an application (and we’ve seen this many times) and you don’t have access to the SDK source code, what do you do?  In situations like these, you and your project are completely at the mercy of the SDK vendor to diagnose and resolve the issue.

With an open source SDK, however, it’s possible to get traces back and determine the root cause of any problems.  Because you can see what is happening in the SDK code and how it interacts with your app, you can also address poorly written code that may be causing crashes, poor performance, and increased latency.  You can also see if the code is doing something (like collecting data) that you might not otherwise want to permit.

When it comes to mobile analytics platforms, this applies not only to the SDK but the platform as a whole.   Most, if not all, mobile analytics platform are closed source and black box; customers have very little control of how they work, how the data is stored, whether the data can be migrated to another platform or vendor, and whether they are truly comply with applicable regulatory and privacy standards.   With an open-source platform such as Countly’s Community and Enterprise Editions you, and only you, own the data and you have the ability to tune and configure the platform to meet your specific needs.

For more information you can  view the Countly SDK on Github, download Countly Community Edition to try on your own premise, sign up for Countly Cloud to see how it works for you, or read more about our enterprise offerings, including Countly Enterprise Edition.