-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
35 lines (33 loc) · 1.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/css/reset.css">
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.css">
<script src="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.js"></script>
</head>
<body class="mixpanel-platform-body">
<script>
MP.api.ready(function() {
var eventName = 'App Open';
var $mau = MP.api.segment(eventName, 'mp_country_code', {
from: moment().subtract(10, 'months'),
to: moment(),
type: 'unique',
unit: 'month'
});
var $dau = MP.api.segment(eventName, 'mp_country_code', {
from: moment().subtract(30, 'days'),
to: moment(),
type: 'unique',
unit: 'day'
});
$.when($dau, $mau).done(function(dau, mau) {
$('<div></div>').appendTo('body').MPChart({
chartType: 'map',
data: dau.avg().divide(mau.avg())
});
});
});
</script>
</body>
</html>