Skip to content
pedroduran edited this page Jul 4, 2013 · 9 revisions

A beacon is the chosen name to designate the "event" or something that you want to track. So, it's needed to init the application with activated beacons.

Note: When you use Xcode console the beacons are sent when you push Home button and not when you stop the process.

Track events

For get stats of actions, views, etc, you must use:

For start:

[MalcomLib startBeaconWithName:@"ViewController"];

Also you can send a beacon with params with this method:

[MalcomLib startBeaconWithName:@"ViewController" andParams:[ [NSDictionary alloc] initWithObjectsAndKeys:@"1", @"test1",@"2", @"test2", nil] andTimeSession:timeSession];

where 'timeSession' is a variable that indicates if a beacon mark am eventually event (timeSession=NO) or a time event (timeSession=YES).

For end and send:

[MalcomLib endBeaconWithName:@"ViewController"];

Also if we want to add additional parameters or modify the previous one we can use the function:

[MalcomLib endBeaconWithName:@"ViewController" andParams:[ [NSDictionary alloc] initWithObjectsAndKeys:@"2", @"Prueba1",@"4", @"Prueba2",@"6", @"Prueba3", nil]]; 

Setting Tags

Malcom allows you to split your users and identify sections. Imagine you want to identify the users that want to receive info about "sports". Then, when the user selects to receive this info, this device could be tagged with the "sports" tag. Automatically, Malcom servers will receive this new tag on real time and you will be able to send push notifications to desired people.

To add tags you should use the following method:

    [MalcomLib setTags:tags];

where 'tags' is a string nsarray.

Identifying users

Malcom as well, has the potential to identify users if you want. Just call this method in the proper point of your app (once you have the desired info):

   [MalcomLib identifyUserWithName:@"John Appleseed" mail:@"john.appleseed@me.com"];

If you want to add more info to the user simply create a NSMutableDictionary an fulfill it with the desired info. Aftewards, use this method like you'll see in the following example:

   //creates the dictionary
   NSMutableDictionary *additionalInfoDictionary = [[NSMutableDictionary alloc] init];
   
   //populates it with info
   [additionalInfoDictionary setObject:@"679768973" forKey:@"mobile"];
   [additionalInfoDictionary setObject:@"20" forKey:@"age"];

   //sends to Malcom with additional info
   [MalcomLib identifyUserWithName:@"John Appleseed" mail:@"john.appleseed@me.com" andParams:additionalInfoDictionary];

Revenues on real time

Malcom provides you a method if you want to track the revenues of your in-app purchases in real time. Just call the following method:

   [MalcomLib registerRevenueWithName:@"Product1" SKU:@"V4C3D5C2" price:1.79 currencyCode:@"EUR" andAmount:1];

Tracking Views

As well, you could track the viewed pages of your app in order to separate the statistics from the events. Simply call with the desired name the method:

   [MalcomLib trackView:@"MainScreen"];
Clone this wiki locally