lib/mixpanel/person.rb in mixpanel-3.4.0 vs lib/mixpanel/person.rb in mixpanel-3.5.0
- old
+ new
@@ -9,9 +9,23 @@
def increment(distinct_id, properties={}, options={})
engage :add, distinct_id, properties, options
end
+ def track_charge(distinct_id, amount, time=Time.now, options={})
+ charge_properties = {
+ '$transactions' => {
+ '$amount' => amount,
+ '$time' => time,
+ }
+ }
+ engage :append, distinct_id, charge_properties, options
+ end
+
+ def reset_charges(distinct_id, options={})
+ engage :set, distinct_id, { '$transactions' => [] }, options
+ end
+
def append_set(properties={})
append 'people.set', properties_hash(properties, PERSON_PROPERTIES)
end
def append_increment(property, increment=1)