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 uses often, and what time 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, it will be more pleasant to read in French than in English). From this introductory part ends, let's start the implementation of analytics in your 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 application name, its version and product category. All other items - at your request and discretion.
2) After successfully adding an application, you need to create its version! For this, there will be an
Add Version link below, where we indicate the platform - iPhone (just what we need), Android (the SDK promises to be released in the near foreseeable 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 remember to remember where the unique ID is for your application, it looks like this:
ID : 8ac5b4614774458e096c53a6d8bfd66de8f7fcbd
(every coincidence with real IDs is random!)
')
3) After this minute mess with the papers, we have to download the SDK itself!
Go to
Downloads and download the latest version, today it is 2.0.37.
The second thing to do is to connect lib to our program, this is done with just a few clicks:
1)
libMMTracking.a connect to the list of frameworks
2)
MMEvent.h and
MMTrackingMgr.h to the list of project hiders
3) Because of the features, it is necessary to connect four libraries to the frameworks, namely:
"libz.1.2.3.dylib" ,
"libsqlite3.0.dylib" ,
"CoreLocation.framework" and
"SystemConfiguration.framework"not difficult yet, right? Then go 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 we look at the
“Bundle version” line , its value should correspond to the version indicated on the site!
That's it, now we are ready to proceed with the collection of analytics!
So, open the file with delegate implementation, and copy the following code:
#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 such items:
1) Application start and end time
2) Device type and model
3) OS version
4) Unique Device ID
5) Version of your application
6) Geographical coordinates of the place from which your program was launched (disable this item)
From the base collection, we disable only the 6th item, all the others 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 their location.
Now, after 36 hours (at first I thought I was doing something wrong!) On the website in the
App Reports section, we can observe this picture:

From the side, as you can see, you can go through different bookmarks, and look at the charts if there are few digits.
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 about it next time!
PS: Wonderful documentation for all occasions goes along with the SDK.