Skip to content

Commit 21452fe

Browse files
Added readme
1 parent 3c5b141 commit 21452fe

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
# Interakt.Track.PythonSdk
1+
# Interakt Track Python
2+
3+
# Getting Started
4+
5+
Install `interakt-track-python` using pip
6+
7+
pip install interakt-track-python
8+
9+
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.
53+
54+
Example `event` call:
55+
```
56+
track.event(
57+
user_id="changu_mangu",
58+
event="Add to Cart",
59+
traits={"amount": 200}
60+
)
61+
```

track/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.0.7'
1+
VERSION = '0.0.8'

0 commit comments

Comments
 (0)