Merge pull request #21471 from Manduro/mixpanel

mixpanel: 2.14 with new method
This commit is contained in:
Benjamin Lichtman
2017-11-21 09:46:18 -08:00
committed by GitHub
2 changed files with 21 additions and 1 deletions
+16 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Mixpanel 2.13
// Type definitions for Mixpanel 2.14
// Project: https://mixpanel.com/
// https://github.com/mixpanel/mixpanel-js
// Definitions by: Knut Eirik Leira Hjelle <https://github.com/hjellek>
@@ -348,6 +348,21 @@ declare namespace Mixpanel {
set_once(prop: string, value: any, callback?: () => void): void;
set_once(keys: { [index: string]: any }, callback?: () => void): void;
/**
* Unset properties on a user record (permanently removes the properties and their values from a profile).
*
* ### Usage:
*
* mixpanel.people.unset('gender');
*
* // or unset multiple properties at once
* mixpanel.people.unset(['gender', 'Company']);
*
* @param prop If a string, this is the name of the property. If an array, this is a list of property names.
* @param callback If provided, the callback will be called after the tracking event
*/
unset(prop: string | string[], callback?: () => void): void;
/**
* Increment/decrement numeric people analytics properties.
*
+5
View File
@@ -95,6 +95,11 @@ function mixpanel_people() {
'Starting Plan': 'Premium'
}, () => {});
mixpanel.people.unset('Company');
mixpanel.people.unset('Company', () => {});
mixpanel.people.unset(['Company', 'Plan']);
mixpanel.people.unset(['Company', 'Plan'], () => {});
mixpanel.people.increment('page_views');
mixpanel.people.increment('page_views', 1);
mixpanel.people.increment('credits_left', -1);