Analytics Collection for iPhone Application

    Hi,% username%

    Many of you would like to know, and many probably already know how much time a user spends on your program, what features he often uses, and what just once in his life, it would also be useful to know where your users live, why ? At least to improve the localization of the application (for example, people living in France will be more pleasant to read in French than in English). With this, the introductory part ends, let's start implementing analytics in our application!

    The first thing we need to do is register here and create our first project.
    1) Select "Create a New App"and then fill in the required fields - the development team, the name of the application, its version and product category. All other items - at your request and discretion.

    2) After successfully adding the application, you need to create its version! To do this, there will be an Add Version link below , where we indicate the platform - iPhone (just what we need), Android (they promise to release the SDK in the near future) or another platform. Next - the version of the program, this is exactly the one that we will use in our application to record analytics. And finally the release date. Also do not forget to remember where the unique ID for your application is located, it looks something like this:
    ID : 8ac5b4614774458e096c53a6d8bfd66de8f7fcbd
    (any coincidence of IDs with real ones is random!)

    3) After this minute fuss with papers, we must download the SDK itself!
    We go into Downloads and download the latest version, today it is 2.0.37.

    The second thing to do is to connect the lib to our program, this is done in just a few clicks:
    1) libMMTracking.a we connect to the list of frameworks
    2) MMEvent.h and MMTrackingMgr.h to the list of project headers
    3) Due to the peculiarities of the lib, Four libraries are still connected to the frameworks, namely: “libz.1.2.3.dylib” , “libsqlite3.0.dylib” , “CoreLocation.framework” and “SystemConfiguration.framework”

    not difficult yet, right? Then we went further:

    4) Open your info-plist file and add the following line:
    MMAppID , where we write the same ID that we received when creating the project
    5) Next, look at the “Bundle version” line , its value should correspond to the version indicated on the site !

    Everything, now everything is ready for us to begin collecting analytics!

    So, open the file with the delegate’s implementation, and copy the following code here:

    #import «MMTrackingMgr.h»

    @implementation <название вашего класса>

    + (void)initialize
    {
    [ [ MMTrackingMgr sharedInstance ] startDefaultTracking ];
    }

    * This source code was highlighted with Source Code Highlighter.


    That's all! We have included a basic collection of information that includes the following items:
    1) Application startup and completion time
    2) Device type and model
    3) OS version
    4) Unique device ID
    5) Your application version
    6) Geographic coordinates of the place where your program was launched (disable this item)

    From the base fee, disable only the 6th item, all the rest are collected in the database, and sent to the server as soon as the phone finds an active connection. If the 6th item is not disabled, then the user will need permission to send his location.

    Now after 36 hours (at first I thought that I was doing something wrong!) On the site in the section App Reports , we can observe just such a picture:
    image
    On the side, as you can see, you can go through different bookmarks, and look at the graphs if the numbers are few.

    The post does not mention the creation of your own events, with which you can track the use of the interface and other statistics. Hope this next time!

    PS: Together with the SDK there is wonderful documentation for all occasions.

    Also popular now: