-
Notifications
You must be signed in to change notification settings - Fork 1
Community Bonding Period II
Tarun Kumar Singhal edited this page May 31, 2017
·
13 revisions
The primary focus of the previous week was to come up with the list of events which can be used for tracking user behavior in sugarizer. Following is the structure finalized for the logs collection in MongoDB.
[{
"user_id" : "592d4445cc8be9187abb284f",
"user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
"user_ip" : "122.34.42.165",
"client_type" : "mobile",
"source" : "sugarizer",
"event_object" : "home_view",
"event_action" : "search",
"event_label" : "q=stopwatch",
"event_value" : "null",
"timestamp" : "6712375127"
}]
- user_id : id of user
- user_agent : user agent
- user_ip : ip address
- client_type : web | mobile
- source : where event is being performed. It is "sugarizer" as default and "activityID" when tracking is performed inside an activity.
- event_object : parts of pages that we want visitors to interact with
- event_action : type of event
- event_label : used to identify specific activity
- event_value : data assiciated with event
- timestamp : timestamp
//multiple log entry can be inserted at the same time
"[POST]" /api/v1/stats
//fetch log entry from database
"[GET]" /api/v1/stats?params=xxxx......
//to get all unique users with ip which can be used to plot users over the world map
"[GET]" /api/v1/stats?fields=uid,ip&unique=true
---------------------------------
list of params for GET request
---------------------------------
uid : user id
stime : start time (default : timestamp - 10yrs)
etime : end time (default : current timestamp)
event_object : event_object
event_action : event_action
unique : true/false (get unique data)
This strikes to the end of Community Bonding Period and beginning of the code period.
