-
Notifications
You must be signed in to change notification settings - Fork 0
0.4 | Retrieve Statistics API
(returned statistics are structured according to the frontend render need)
Note: Only admin users can access these statistics api. Tester should login to admin first before using these below.
Get the total number of visiting user in the date range provided. If given an array of location or an array of reply id or both as the input, then the number of visiting user in those locations and who chose those replies will get returned.
required query: { startDate: str (in the form of "yyyy-mm-dd"), endDate: str (in the form of "yyyy-mm-dd") }
optional query:
- {locationArr[]: str(in the form of "city country")}
- {ridArr[]: str}
(Note: To input array in query, provide multiple key value pairs with the provided key name (e.g. "locationArr[]"), and each key value pair contains one value of the array)
return:
- If none of locationArr nor ridArr are provided, all the structured user visit statistics between the start date and the end date will be returned (per day per location)
[{date: str, location: str, visit: number }]
- If the locationArr is provided, all the structured user visit statistics from these locations between the required dates will be returned (per reply per location)
[{reply: str, location: str, visit: number }]
- If the replyArr is provided, all the structured visit statistics from users who chose these replies between the required dates will be returned (per location per reply)
[{location: str, reply: str, visit: number }]
- If both of these arrays are provided, all the structured visit statistics satisfying both requirements between the required dates will be returned (per reply per location).
[{reply: str, location: str, visit: number }]
Get the average stay time of users in the date range provided.
required query: { startDate: str (in the form of "yyyy-mm-dd"), endDate: str (in the form of "yyyy-mm-dd"), from: string (either "reply" or "location" }
return:
- If required from "location", the average session duration and average page duration between the required dates organized by location will be returned.
{averageSessionDuration: [{location: str, averageSessionDuration: number}], averagePageDuration: [{location: str, averagePageDuration: number}] }
- If required from "reply", the average session duration and average page duration between the required dates organized by reply will be returned.
{averageSessionDuration: [{reply: str, averageSessionDuration: number}], averagePageDuration: [{reply: str, averagePageDuration: number}] }
Get the number of usage of different devices when accessing the website in the date range provided.
required query: { startDate: str (in the form of "yyyy-mm-dd"), endDate: string (in the form of "yyyy-mm-dd")} optional query: { from: str (either "reply" or "location") }
return:
- If "from" value is not specified, the number of user using different devices between the required dates will get returned.
[{platform: str, user: number}]
- If required from "location", the number of user using different devices between the required dates organized by location will be returned.
[{reply: str, platform: str, user: number}]
- If required from "reply", the number of user using different devices between the required dates organized by reply will be returned.
[{location: str, platform: str, user: number}]
(all the returned reply name in the above api are in the form of "replyLabel/replyContent")