I have a local countly installation, I have been able to make it multi tenet, now any dev from my organization can make an account on it, make applications under his account, and send data on it.
We would like to add some more data to our dashboard, like "Gender","age" e.t.c, and that I suppose will be in form of another metric like "device details" and "carriers", I would like know how do we add a custom metric to it.
I am new to nodejs and express, but I am getting hang of it, so just elementary know how will do, anyways I am reading code at the moment, so If I realize how to do it, i'll post it here as well.
There is a generic piece of code which gets the params from incoming http request, and throws them to the db, like all other params, the new collection is also made by this process automatically.
in file api/parts/data/usage.js
var predefinedMetrics = [
{ db: "devices", metrics: [{ name: "_device", set: "devices", short_code: common.dbUserMap['device'] }] },
{ db: "carriers", metrics: [{ name: "_carrier", set: "carriers", short_code: common.dbUserMap['carrier'] }] },
{ db: "device_details", metrics: [{ name: "_os", set: "os", short_code: common.dbUserMap['platform'] }, { name: "_os_version", set: "os_versions", short_code: common.dbUserMap['platform_version'] }, { name: "_resolution", set: "resolutions" }] },
{ db: "app_versions", metrics: [{ name: "_app_version", set: "app_versions", short_code: common.dbUserMap['app_version'] }] },
{ db: "gender", metrics: [{ name: "_gender", set: "gender", short_code: common.dbUserMap['gender'] }] }]
I just added gender to this list of predefined metrices, and now when i send the gender along with my http request, it gets saved easily.
Now I am working on rendering it on dashboard.