Skip to content

Commit 0bccceb

Browse files
committed
Add people_clear_charges method to python sdk
1 parent bde09df commit 0bccceb

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎mixpanel/__init__.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,25 @@ def people_track_charge(self, distinct_id, amount, properties={}, meta={}):
201201
revenue report.
202202
Example:
203203
#tracks a charge of $50 to user '1234'
204-
mp.track_charge('1234', 50)
204+
mp.people_track_charge('1234', 50)
205205
206206
#tracks a charge of $50 to user '1234' at a specific time
207-
mp.track_charge('1234', 50, {'$time': "2013-04-01T09:02:00"})
207+
mp.people_track_charge('1234', 50, {'$time': "2013-04-01T09:02:00"})
208208
"""
209209
properties.update({'$amount': amount})
210210
return self.people_append(distinct_id, {'$transactions': properties}, meta=meta)
211211

212+
def people_clear_charges(self, distinct_id, meta={}):
213+
"""
214+
Clears all charges from a user.
215+
216+
Clears all charges associated with a user profile on Mixpanel.
217+
Example:
218+
#clear all charges from user '1234'
219+
mp.people_clear_charges('1234')
220+
"""
221+
return self.people_unset(distinct_id, ["$transactions"], meta=meta)
222+
212223
def people_update(self, message, meta={}):
213224
"""
214225
Send a generic update to Mixpanel people analytics.

0 commit comments

Comments
 (0)