COLLECT | STORE | QUERY | PRESENT
Ship customer-facing metrics in an afternoon, not months
CREATE ACCOUNT
Questions? Talk to an expert.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
client.recordEvent({
collection: 'purchases',
event: {
price: 50.00,
user: {
id: '020939382',
age: 28
},
artist: {
id: '19039',
name: 'Tycho'
},
venue: {
id: 'A',
name: 'The Fillmore',
city: 'San Francisco',
state: 'California'
}
}
});
{
"created": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
client
.query({
analysis_type: 'count',
event_collection: 'purchases',
timeframe: 'previous_6_months',
group_by: 'user.email',
filters: [
{
property_name: 'geo.city',
operator: 'eq',
property_value: 'San Francisco'
}
]
})
.then(result => {
// handle the result
});
{
"result": [
{
"user.email": "mark@keen.io",
"result": 39
},
{
"user.email": "john@keen.io",
"result": 27
},
{
"user.email": "kirk@keen.io",
"result": 32
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
client
.query({
analysis_type: 'count',
event_collection: 'pageviews',
timeframe: 'this_7_days',
interval: 'daily',
group_by: 'utm_source'
})
.then(results => {
new KeenDataviz({
container: '#keen-dataviz-demo',
title: 'VIEWS BY TOP 3 SOURCES',
type: 'area-spline',
legend: {
position: 'bottom'
},
results
});
});