-
Notifications
You must be signed in to change notification settings - Fork 1
/
analytics.go
69 lines (62 loc) · 1.95 KB
/
analytics.go
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package register
/*
type AnalyticsFunc func(context.Context, AnalyticsEvent) error
type AnalyticsFunction struct {
reg *FunctionRegistrar
fn AnalyticsFunc
}
// AnalyticsEvent is the payload of an Analytics log event.
type AnalyticsEvent struct {
EventDimensions []EventDimensions `json:"eventDim"`
UserDimensions interface{} `json:"userDim"`
}
// EventDimensions holds Analytics event dimensions.
type EventDimensions struct {
Name string `json:"name"`
Date string `json:"date"`
TimestampMicros string `json:"timestampMicros"`
PreviousTimestampMicros string `json:"previousTimestampMicros"`
Params interface{} `json:"params"`
}
*/
/*
{
"eventDim": [ // Contains a single event
{
"date": "20090213",
"name": "screen_view",
"params": {
"firebase_conversion": {
"intValue": "1"
},
"firebase_event_origin": {
"stringValue": "auto"
},
"firebase_previous_class": {
"stringValue": "MainActivity"
},
"firebase_previous_id": {
"intValue": "1928209043426257906"
},
"firebase_previous_screen": {
"stringValue": "id-D-D"
},
"firebase_screen": {
"stringValue": "id-C-C"
},
"firebase_screen_class": {
"stringValue": "MainActivity"
},
"firebase_screen_id": {
"intValue": "1234567890000"
}
},
"previousTimestampMicros": "1234567890000",
"timestampMicros": "1234567890000"
}
],
"userDim": {
// A UserDimensions object
}
}
*/