-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.htm
55 lines (39 loc) · 1 KB
/
test.htm
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script src="dist/beaver-logger.js"></script>
<script>
$logger.init({
uri: '/api/test'
});
$logger.addMetaBuilder(function() {
return {
token: 'EC-XXXXXX'
}
});
$logger.addPayloadBuilder(function() {
return {
extraTS: Date.now()
}
});
$logger.addHeaderBuilder(function() {
return {
'x-csrf-token': '323432ln23'
}
});
window.addEventListener('load', function() {
$logger.info('my_event');
});
$logger.endTransition('login');
$logger.track({
foo: 'bar',
boo: 'baz'
})
// User enters data on page
setTimeout(function() {
// User does something to trigger a page transition
$logger.startTransition();
// We make some ajax calls and show a loading spinner
setTimeout(function() {
// We land on the review page
$logger.endTransition('review');
}, 1000);
}, 1000);
</script>