Skip to content

Commit 36281e3

Browse files
Merge pull request #6 from interakt/develop
Develop
2 parents cfbb46e + 3b98eee commit 36281e3

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ install:
77
python3 setup.py sdist bdist_wheel
88
pip3 install -e .
99

10-
.PHONY: release install
10+
uninstall:
11+
pip3 uninstall interakt-track-python
12+
13+
.PHONY: release install uninstall
1114

1215

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ track.on_error = on_error
4242

4343
# APIs
4444
## User
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.
45+
The track `user` call 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.
4646

4747
Example `user` call:
4848
```
4949
track.user(
50-
userId="<user_id in your db>",
50+
user_id="<user_id in your db>",
5151
traits={
5252
"name": "John Doe",
5353
"email": "john@email.com",
@@ -58,15 +58,15 @@ track.user(
5858
#### The `user` call has the following fields:
5959
|Field|Data type|Description|
6060
|--|--|--|
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")|
61+
|user_id|str or int|The ID for the user in your database.|
62+
|country_code|str|country code for the phone_number (default value is "+91")|
63+
|phone_number|str|phone_number without country_code (eg: "9876598765")|
6464
|traits|dict|A dict of traits you know about the user. Things like: `email`, `name` or `age`|
6565

6666
**NOTE:** Atleast one of these two is required for user identification :
6767

68-
- **userId**, OR
69-
- **phoneNumber** with **countryCode**
68+
- **user_id**, OR
69+
- **phone_number** with **country_code**
7070

7171

7272

@@ -76,7 +76,7 @@ track.user(
7676
Example `event` call:
7777
```
7878
track.event(
79-
userId="<user id in your db>",
79+
user_id="<user id in your db>",
8080
event="Product Added",
8181
traits={"price": 200}
8282
)
@@ -85,6 +85,6 @@ track.event(
8585

8686
|Field|Data type|Description|
8787
|--|--|--|
88-
|userId|str or int|The ID for the user in your database.|
88+
|user_id|str or int|The ID for the user in your database.|
8989
|event|str|Name of the event you want to track, For eg: "Product Added".|
9090
|traits|dict|dictionary of properties for the event. If the event was **Product Added**, it might have properties like `price` or `product_name`.|

track/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
max_queue_size = 10000
1515

1616

17-
def identify(user_id=None, country_code='+91', phone_number=None, traits={}):
17+
def user(user_id=None, country_code='+91', phone_number=None, traits={}):
1818
"""Send an identify call for customer"""
19-
return _proxy('identify', user_id=user_id, country_code=country_code,
19+
return _proxy('user', user_id=user_id, country_code=country_code,
2020
phone_number=phone_number, traits=traits)
2121

2222

track/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, write_key=None, host=None, debug=False,
4545
)
4646
self.consumer.start()
4747

48-
def identify(self, user_id=None, country_code='+91', phone_number=None, traits={}):
48+
def user(self, user_id=None, country_code='+91', phone_number=None, traits={}):
4949
"""Tie a user to their actions and record traits about them."""
5050
if not user_id and not phone_number:
5151
raise AssertionError("Either user_id or phone_number is required")
@@ -60,7 +60,7 @@ def identify(self, user_id=None, country_code='+91', phone_number=None, traits={
6060
'phoneNumber': phone_number,
6161
'traits': traits
6262
}
63-
return self.__queue_request(path=ApiPaths.Identify.value, body=body)
63+
return self.__queue_request(path=ApiPaths.User.value, body=body)
6464

6565
def event(self, user_id=None, event=None, traits={}):
6666
"""To record user events"""

track/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55

66
class ApiPaths(enum.Enum):
7-
Identify = '/v1/public/track/users/'
7+
User = '/v1/public/track/users/'
88
Event = '/v1/public/track/events/'

track/version.py

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

0 commit comments

Comments
 (0)