Skip to content

Commit 201db6c

Browse files
authored
docs (#45)
* docs * import call out
1 parent 7a1c708 commit 201db6c

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

examples/import.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ func ImportExample() error {
1515
// fill in your token and project id and service account user name and secret
1616
mp := mixpanel.NewClient(
1717
"token",
18+
// Need to provide project id if you want to use the import api
1819
mixpanel.ProjectID(0),
20+
// Need to provide service account or api secret if you want to use the import api
1921
mixpanel.ServiceAccount("user_name", "secret"),
2022
)
2123

examples/merge.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ func Merge() error {
1111

1212
mp := mixpanel.NewClient(
1313
"token",
14+
// Need to provide api secret if you want to use the merge api
15+
mixpanel.ApiSecret("secret"),
1416
)
1517

1618
// Can use the SetReversedProperty or make the reserved property yourself

identity.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type aliasProperties struct {
1818
Token string `json:"token"`
1919
}
2020

21+
// https://developer.mixpanel.com/reference/identity-create-alias
2122
func (m *Mixpanel) Alias(ctx context.Context, aliasID, distinctID string) error {
2223
payload := &aliasPayload{
2324
Event: "$create_alias",
@@ -40,6 +41,8 @@ type mergeProperties struct {
4041
DistinctId []string `json:"$distinct_ids"`
4142
}
4243

44+
// https://developer.mixpanel.com/reference/identity-merge
45+
// must provide api secret
4346
func (m *Mixpanel) Merge(ctx context.Context, distinctID1, distinctID2 string) error {
4447
payload := &mergePayload{
4548
Event: "$merge",

ingestion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func (e ImportGenericError) Error() string {
126126

127127
// Import calls the Import api
128128
// https://developer.mixpanel.com/reference/import-events
129+
// Need to provide project id and api secret or service account
129130
func (m *Mixpanel) Import(ctx context.Context, events []*Event, options ImportOptions) (*ImportSuccess, error) {
130131
if len(events) > MaxImportEvents {
131132
return nil, fmt.Errorf("max import events is %d", MaxImportEvents)

0 commit comments

Comments
 (0)