Skip to content

Recipe Analytics

Recipe Funnel

An API allows you to get a funnel representation of the results of a recipe made of various events.
Many events are provided directly by NearIT, others can be customized for your app.

GET https://api.nearit.com/trackings/search
Parameter Description
recipe_id ID of your recipe
filter[unique] If true filters data by unique user

Response

The API will return a list of events and the number of "hits" happened. The weight meta expresses the typical event order:

{
   "data":[
      {
         "id":"notified",
         "type":"hits",
         "attributes":{
            "event":"notified",
            "hits":67
         },
         "meta":{
            "weight":1
         }
      },
      {
         "id":"engaged",
         "type":"hits",
         "attributes":{
            "event":"engaged",
            "hits":24
         },
         "meta":{
            "weight":5
         }
      },
      {
         "id":"redeemed",
         "type":"hits",
         "attributes":{
            "event":"redeemed",
            "hits":11
         },
         "meta":{
            "weight":10
         }
      }
   ]
}
Event Description
notified Notification received
engaged Notification tapped
redeemed Coupon redeemed
gave_feedback Answer to feedback request

Recipe Summary

The same API with additional parameters returns a report containing the results of the recipe over time.

GET https://api.nearit.com/trackings/search
Parameter Description
recipe_id ID of your recipe
shard Data granularity in the format "n day
filter[app_id] NearIT app ID
filter[event] List of events of interest (see table above, events should be expressed as comma-separated values)
filter[period][start] starting date (yyyy/mm/dd hh:mm)
filter[period][end] end date (yyyy/mm/dd hh:mm) (included)
filter[unique] If true filters data by unique user

Response

The API will return a list containing every event you selected. Each event contains a list of timestamp/value objects (timestamp is express as Unix Epoch msec):

{
   "data":[
      {
         "id":"engaged",
         "type":"series",
         "attributes":{
            "name":"engaged",
            "data":[
               [ 1518220800000, 4 ],
               [ 1518307200000, 1 ],
               [ 1518393600000, 1 ],
               [ 1518480000000, 2 ],
               [ 1518566400000, 2 ],
               [ 1518652800000, 1 ],
               [ 1518998400000, 2 ],
               [ 1519084800000, 4 ]
            ]          
         },
         "meta":{
            "weight":5
         }
      },
      {
         "id":"notified",
         "type":"series",
         "attributes":{
            "name":"notified",
            "data":[
               [ 1518220800000, 8 ],
               [ 1518307200000, 11 ],
               [ 1518393600000, 4 ],
               [ 1518480000000, 8 ],
               [ 1518566400000, 9 ],
               [ 1518652800000, 5 ],
               [ 1518739200000, 7 ],
               [ 1518825600000, 9 ],
               [ 1518912000000, 8 ],
               [ 1518998400000, 6 ],
               [ 1519084800000, 7 ]
            ]
         },
         "meta":{
            "weight":1
         }
      }
   ]
}

General Summary

You can use the same API without the "recipe_id" parameter to get a general report with the combined results of every recipe.