You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,6 @@ import track
14
14
15
15
track.api_key = "YOUR_API_KEY"
16
16
```
17
-
Interakt Track APIs uses HTTP Basic Auth, which involves a `‘username:password’` that is **base64 encoded** and prepended with the string `‘Basic ‘`.
18
-
19
-
Your **api_key** is your `username` and `password` is empty. Which means if your **api_key** is `'abcd123'`, a colon is added to it, and then the password field is left empty.
20
-
21
-
After base64 encoding `'abcd123:'` becomes `'YWJjZDEyMzo='`; and this is passed in the authorization header like so: `'Authorization: Basic YWJjZDEyMzo='`
22
-
23
17
24
18
25
19
## Development Settings
@@ -47,32 +41,32 @@ track.on_error = on_error
47
41
48
42
49
43
# APIs
50
-
## Identify
44
+
## User
51
45
The `identify` lets you tie a user to their actions and record traits about them. It includes a unique **User ID** or **Phone Number and Country Code** any optional traits you know about them.
52
46
53
-
Example `identify` call:
47
+
Example `user` call:
54
48
```
55
-
track.identify(
56
-
user_id="<user_id in your db>",
49
+
track.user(
50
+
userId="<user_id in your db>",
57
51
traits={
58
52
"name": "John Doe",
59
53
"email": "john@email.com",
60
54
"age": 24
61
55
}
62
56
)
63
57
```
64
-
#### The `identify` call has the following fields:
58
+
#### The `user` call has the following fields:
65
59
|Field|Data type|Description|
66
60
|--|--|--|
67
-
|user_id|str or int|The ID for the user in your database.|
68
-
|country_code|str|country code for the phone_number (default value is "+91")|
69
-
|phone_number|str|phone_number without country_code (eg: "9876598765")|
61
+
|userId|str or int|The ID for the user in your database.|
62
+
|countryCode|str|country code for the phone_number (default value is "+91")|
63
+
|phoneNumber|str|phone_number without country_code (eg: "9876598765")|
70
64
|traits|dict|A dict of traits you know about the user. Things like: `email`, `name` or `age`|
71
65
72
66
**NOTE:** Atleast one of these two is required for user identification :
73
67
74
-
-**user_id**, OR
75
-
-**phone_number** with **country_code**
68
+
-**userId**, OR
69
+
-**phoneNumber** with **countryCode**
76
70
77
71
78
72
@@ -82,7 +76,7 @@ track.identify(
82
76
Example `event` call:
83
77
```
84
78
track.event(
85
-
user_id="<user_id in your db>",
79
+
userId="<user id in your db>",
86
80
event="Product Added",
87
81
traits={"price": 200}
88
82
)
@@ -91,6 +85,6 @@ track.event(
91
85
92
86
|Field|Data type|Description|
93
87
|--|--|--|
94
-
|user_id|str or int|The ID for the user in your database.|
88
+
|userId|str or int|The ID for the user in your database.|
95
89
|event|str|Name of the event you want to track, For eg: "Product Added".|
96
90
|traits|dict|dictionary of properties for the event. If the event was **Product Added**, it might have properties like `price` or `product_name`.|
0 commit comments