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
Inside your app, you’ll want to **set your**`write_key` before making any track calls:
10
+
11
+
import track
12
+
13
+
track.write_key = "YOUR_WRITE_KEY"
14
+
15
+
16
+
## Development Settings
17
+
18
+
The default initialization settings are production-ready and queue messages to be processed by a background thread.
19
+
20
+
In development you might want to enable some settings to make it easier to spot problems. Enabling `track.debug` will log debugging info to the Python logger. You can also add an `on_error` handler to specifically print out the response you’re seeing from our API.
21
+
```
22
+
def on_error(error, items):
23
+
print("An error occurred:", error)
24
+
25
+
26
+
track.debug = True
27
+
track.on_error = on_error
28
+
29
+
```
30
+
31
+
# Identify
32
+
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.
33
+
34
+
Either of the two for user identification is required:
35
+
36
+
-**user_id**
37
+
-**phone_number** with **country_code**
38
+
39
+
Example `identify` call:
40
+
```
41
+
track.identify(
42
+
user_id="<USER_ID>",
43
+
traits={
44
+
"name": "John Doe",
45
+
"email": "john@email.com",
46
+
"age": 24
47
+
}
48
+
)
49
+
```
50
+
51
+
# Event
52
+
`event` lets you record the actions your users perform. Every action triggers what we call an “event”, which can also have associated properties.
0 commit comments