- Here you can set:-
- visitors count
- Access count
- Or any other
You have to set action it is required and it must define what acction has been performed
This is not mandetory but it is given to more specify a action performed
https://cbkm-analytics-services.herokuapp.com/cbkm
- Register your App It must be unique
- Get the ID save it securely
- Apply it on header of every request
- if you use axios
axios.defaults.headers.common['appID'] = '<yourApp>1565604151669' // for all requests
axios.defaults.headers.post['header1'] = 'value' // for POST requests
This is the root link
https://cbkm-analytics-services.herokuapp.com
To check you are Eligible to use this services
get:- https://cbkm-analytics-services.herokuapp.com/analytics/alive
if response is :-
{"alive":true}
Then you can use thess services
Note:- succes is always send in response with any API It can be true or false if false ,
- Please read complete documentation
if true ,
- Your data has been recorded
post:- https://cbkm-analytics-services.herokuapp.com/analytics/
request:-
{ action:'My-Action'//mandatory name:'My-name'//compulsory }
response :-{success:true}
or {success:false}
You can alos set data through websocket
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.dev.js"></script>
<script>
var socket = io('https://cbkm-analytics-services.herokuapp.com');
function wow() {
data={
appID:"Grab_IT15665642939041",
action:"myaction",
myname:"myname"
}
socket.emit('save', data);
window.location.href = "index.html"
}
</script>
<button onclick="wow()">
click
</button>
get:- https://cbkm-analytics-services.herokuapp.com/analytics/
response :-
{
success:true
data:[
{
_id:ObjectID,
action:'My-Action'
name:'My-Name'
},
.....
]
}
or {success:false}
get:- https://cbkm-analytics-services.herokuapp.com/analytics/action/My-Action
response :-
{
success:true
data:[
{
_id:ObjectID,
action:'My-Action'
name:'My-Name'
},
.....
]
}
or {success:false}
get:- https://cbkm-analytics-services.herokuapp.com/analytics/actioncount/My-Action
response :-
{
success:true
data:15
}
or {success:false}
get:- https://cbkm-analytics-services.herokuapp.com/analytics/actiondelete/My-Action
response :-
{success:true}
or {success:false}
Similar to above
get:- https://cbkm-analytics-services.herokuapp.com/analytics/name/My-Name
get:- https://cbkm-analytics-services.herokuapp.com/analytics/namecount/My-name
get:- https://cbkm-analytics-services.herokuapp.com/analytics/namedelete/My-Name
post:- https://cbkm-analytics-services.herokuapp.com/analytics/specific
request:-
{
action:'my-Action'//optional
name:'my-Name'//optional
stamp:'2019-08-12T04:10:00.320Z'//ISO
}
response :-
{
success:true
data:[
{
_id:ObjectID,
action:'My-Action'
name:'My-Name'
},
.....
]
}
or {success:false}
post:- https://cbkm-analytics-services.herokuapp.com/analytics/specificcount
post:- https://cbkm-analytics-services.herokuapp.com/analytics/specificdelete
From this POST
you will get distinct number of what
from how
condition
post:- https://cbkm-analytics-services.herokuapp.com/analytics/distinct
what
contains name,action,stamp
how
contains specific condition
Note :- How is object
{
what:'name',
how:{
action:'my-action'
}
}
we will get distinct name whose action is my-action
Created By :- Rajaram CBKM