Coder Social home page Coder Social logo

analytics-services's Introduction

CBKM

Analytics API

Introduction

  • Here you can set:-
    • visitors count
    • Access count
    • Or any other
Stamp in IST zone (Asia/Kolkata) in ISO will set Automatically

Model

action:-

You have to set action it is required and it must define what acction has been performed

name:-

This is not mandetory but it is given to more specify a action performed

Register Here

  • 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

APIs

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

Set Data

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 Data

get:- https://cbkm-analytics-services.herokuapp.com/analytics/ response :-

{
success:true
data:[ 
		{
			_id:ObjectID,
			action:'My-Action'
			name:'My-Name'
		},
		.....
	]
}

or {success:false}

Get Data by action

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 action count

get:- https://cbkm-analytics-services.herokuapp.com/analytics/actioncount/My-Action

response :-

{
success:true
data:15
}

or {success:false}

Get action Delete

get:- https://cbkm-analytics-services.herokuapp.com/analytics/actiondelete/My-Action

response :- {success:true}or {success:false}

Some API you may use

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

Some Specific APIs

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}

Smilar Specific route

post:- https://cbkm-analytics-services.herokuapp.com/analytics/specificcount

post:- https://cbkm-analytics-services.herokuapp.com/analytics/specificdelete

Get Distinct API

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

example

{
	what:'name',
	how:{
			action:'my-action'
		}
	
}

we will get distinct name whose action is my-action

Created By :- Rajaram CBKM

analytics-services's People

Contributors

thecbkm avatar cbkm-company avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.