Skip to content

Commit 2c37029

Browse files
authored
fix: add IP property to user object (#62)
1 parent cd8dd95 commit 2c37029

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/amplitude_experiment/assignment/assignment_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def to_event(assignment: Assignment, send_evaluated_props: bool) -> BaseEvent:
1717
user_attributes = [
1818
"country", "city", "region", "dma", "language",
1919
"platform", "version", "os", "device_manufacturer",
20-
"device_brand", "device_model", "carrier"
20+
"device_brand", "device_model", "carrier", "library", "ip_address"
2121
]
2222
for attr in user_attributes:
2323
setattr(event, attr, getattr(assignment.user, attr, None))

src/amplitude_experiment/user.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(
2626
device_model: str = None,
2727
carrier: str = None,
2828
library: str = None,
29+
ip_address: str = None,
2930
user_properties: Dict[str, Any] = None,
3031
groups: Dict[str, List[str]] = None,
3132
group_properties: Dict[str, Dict[str, Dict[str, Any]]] = None,
@@ -50,6 +51,7 @@ def __init__(
5051
device_model (str): Predefined field, must be manually provided
5152
carrier (str): Predefined field, must be manually provided
5253
library (str): Predefined field, must be manually provided
54+
ip_address (str): Predefined field, must be manually provided
5355
user_properties (dict): Custom user properties
5456
groups (dict): Groups associated with the user
5557
group_properties (dict): Properties for groups
@@ -72,6 +74,7 @@ def __init__(
7274
self.device_model = device_model
7375
self.carrier = carrier
7476
self.library = library
77+
self.ip_address = ip_address
7578
self.user_properties = user_properties
7679
self.groups = groups
7780
self.group_properties = group_properties

0 commit comments

Comments
 (0)