mixpanel-react-native
Version:
Official React Native Tracking Library for Mixpanel Analytics
1,634 lines (371 loc) • 18.7 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: People</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: People</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>People<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Core class for using Mixpanel People Analytics features.
<p>The People object is used to update properties in a user's People Analytics record,
and to manage the receipt of push notifications sent via Mixpanel Engage.
For this reason, it's important to call identify(String) on the People
object before you work with it. Once you call identify, the user identity will
persist across stops and starts of your application, until you make another
call to identify using a different id.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="People"><span class="type-signature"></span>new People<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line598">line 598</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="People.html">People</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="append"><span class="type-signature"></span>append<span class="signature">(name, value)</span><span class="type-signature"></span></h4>
<div class="description">
Appends a value to a list-valued property. If the property does not currently exist,
it will be created as a list of one element. If the property does exist and doesn't
currently have a list value, the append will be ignored.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the People Analytics property that should have it's value appended to</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">the new value that will appear at the end of the property's list</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line693">line 693</a>
</li></ul></dd>
</dl>
<h4 class="name" id="clearCharges"><span class="type-signature"></span>clearCharges<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Permanently clear the whole transaction history for the identified people profile.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line784">line 784</a>
</li></ul></dd>
</dl>
<h4 class="name" id="deleteUser"><span class="type-signature"></span>deleteUser<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Permanently deletes the identified user's record from People Analytics.
<p>Calling deleteUser deletes an entire record completely. Any future calls
to People Analytics using the same distinct id will create and store new values.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line794">line 794</a>
</li></ul></dd>
</dl>
<h4 class="name" id="increment"><span class="type-signature"></span>increment<span class="signature">(prop, by)</span><span class="type-signature"></span></h4>
<div class="description">
Add the given amount to an existing property on the identified user. If the user does not already
have the associated property, the amount will be added to zero. To reduce a property,
provide a negative number for the value.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prop</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the People Analytics property that should have its value changed</td>
</tr>
<tr>
<td class="name"><code>by</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">the amount to be added to the current value of the named property</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line657">line 657</a>
</li></ul></dd>
</dl>
<h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(name, value)</span><span class="type-signature"></span></h4>
<div class="description">
Remove value from a list-valued property only if they are already present in the list.
If the property does not currently exist, the remove will be ignored.
If the property exists and is not list-valued, the remove will be ignored.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the People Analytics property that should have it's value removed from</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">the value that will be removed from the property's list</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line738">line 738</a>
</li></ul></dd>
</dl>
<h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(prop, to)</span><span class="type-signature"></span></h4>
<div class="description">
Sets a single property with the given name and value for this user.
The given name and value will be assigned to the user in Mixpanel People Analytics,
possibly overwriting an existing property with the same name.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prop</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the Mixpanel property. This must be a String, for example "Zip Code"</td>
</tr>
<tr>
<td class="name"><code>to</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The value of the Mixpanel property. For "Zip Code", this value might be the String "90210"</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line615">line 615</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setOnce"><span class="type-signature"></span>setOnce<span class="signature">(prop, to)</span><span class="type-signature"></span></h4>
<div class="description">
Works just like set(), except it will not overwrite existing property values. This is useful for properties like "First login date".
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prop</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the Mixpanel property. This must be a String, for example "Zip Code"</td>
</tr>
<tr>
<td class="name"><code>to</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The value of the Mixpanel property. For "Zip Code", this value might be the String "90210"</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line634">line 634</a>
</li></ul></dd>
</dl>
<h4 class="name" id="trackCharge"><span class="type-signature"></span>trackCharge<span class="signature">(charge, properties)</span><span class="type-signature"></span></h4>
<div class="description">
Track a revenue transaction for the identified people profile.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>charge</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">the amount of money exchanged. Positive amounts represent purchases or income from the customer, negative amounts represent refunds or payments to the customer.</td>
</tr>
<tr>
<td class="name"><code>properties</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">an optional collection of properties to associate with this transaction.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line770">line 770</a>
</li></ul></dd>
</dl>
<h4 class="name" id="union"><span class="type-signature"></span>union<span class="signature">(name, value)</span><span class="type-signature"></span></h4>
<div class="description">
Adds values to a list-valued property only if they are not already present in the list.
If the property does not currently exist, it will be created with the given list as it's value.
If the property exists and is not list-valued, the union will be ignored.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of the list-valued property to set or modify</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">an array of values to add to the property value if not already present</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line716">line 716</a>
</li></ul></dd>
</dl>
<h4 class="name" id="unset"><span class="type-signature"></span>unset<span class="signature">(name)</span><span class="type-signature"></span></h4>
<div class="description">
permanently removes the property with the given name from the user's profile
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">name of a property to unset</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line757">line 757</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.html">Mixpanel</a></li><li><a href="MixpanelGroup.html">MixpanelGroup</a></li><li><a href="People.html">People</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Tue May 14 2024 09:36:01 GMT-0700 (Pacific Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>