forked from dukex/mixpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_test.go
More file actions
46 lines (36 loc) · 815 Bytes
/
Copy pathexample_test.go
File metadata and controls
46 lines (36 loc) · 815 Bytes
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
package mixpanel
import (
"time"
)
func ExampleNewMixpanel() {
NewMixpanel("mytoken")
}
func ExampleMixpanel_Identify() {
client := NewMixpanel("mytoken")
client.Identify("1")
}
func ExampleTrack() {
client := NewMixpanel("mytoken")
client.Track("1", "Sign Up", map[string]interface{}{
"from": "email",
})
}
func ExamplePeople_Update() {
var people *People
client := NewMixpanel("mytoken")
people = client.Identify("1")
people.Update("$set", map[string]interface{}{
"$email": "[email protected]",
"$last_login": time.Now(),
"$created": time.Now().String(),
"custom_field": "cool!",
})
}
func ExamplePeople_Track() {
var people *People
client := NewMixpanel("mytoken")
people = client.Identify("1")
people.Track("Sign Up", map[string]interface{}{
"from": "email",
})
}