UNPKG

aws-sdk-mobile-analytics

Version:
1,710 lines (560 loc) 25.7 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Manager</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: Manager</h1> <section> <header> <h2> Manager </h2> </header> <article> <div class="container-overview"> <dt> <h4 class="name" id="Manager"><span class="type-signature"></span>new Manager<span class="signature">(options)</span><span class="type-signature"></span></h4> </dt> <dd> <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>options</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Options">AMA.Client.Options</a></span> | <span class="param-type"><a href="AMA.Client.html">AMA.Client</a></span> </td> <td class="description last">A configuration map for the AMA.Client or an instantiated AMA.Client</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line9">line 9</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="AMA.Client.html">AMA.Client</a></li> </ul> </dd> </dl> </dd> </div> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="createEvent"><span class="type-signature"></span>createEvent<span class="signature">(eventType, <span class="optional">attributes=</span>, <span class="optional">metrics=</span>)</span><span class="type-signature"> &rarr; {<a href="AMA.Client.html#Event">AMA.Client.Event</a>}</span></h4> </dt> <dd> <div class="description"> Function that constructs a Mobile Analytics Event </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>eventType</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">Custom Event Type to be displayed in Console</td> </tr> <tr> <td class="name"><code>attributes=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Attributes">AMA.Client.Attributes</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Map of String attributes</td> </tr> <tr> <td class="name"><code>metrics=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Metrics">AMA.Client.Metrics</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Map of numeric values</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line145">line 145</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Client.html#Event">AMA.Client.Event</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="extendSession"><span class="type-signature"></span>extendSession<span class="signature">(<span class="optional">milliseconds</span>)</span><span class="type-signature"> &rarr; {int}</span></h4> </dt> <dd> <div class="description"> Function to extend the current session. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>milliseconds</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> options.sessionLength </td> <td class="description last">Milliseconds to extend the session by, will default to another session length</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line113">line 113</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The Session expiration (in Milliseconds) </div> <dl> <dt> Type </dt> <dd> <span class="param-type">int</span> </dd> </dl> </dd> <dt> <h4 class="name" id="recordEvent"><span class="type-signature"></span>recordEvent<span class="signature">(eventType, <span class="optional">attributes=</span>, <span class="optional">metrics=</span>)</span><span class="type-signature"> &rarr; {<a href="AMA.Client.html#Event">AMA.Client.Event</a>}</span></h4> </dt> <dd> <div class="description"> Function to record a custom event </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>eventType</code></td> <td class="type"> </td> <td class="attributes"> </td> <td class="description last">Custom event type name</td> </tr> <tr> <td class="name"><code>attributes=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Attributes">AMA.Client.Attributes</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Custom attributes</td> </tr> <tr> <td class="name"><code>metrics=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Metrics">AMA.Client.Metrics</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Custom metrics</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line156">line 156</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The event that was recorded </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Client.html#Event">AMA.Client.Event</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="recordMonetizationEvent"><span class="type-signature"></span>recordMonetizationEvent<span class="signature">(monetizationDetails, <span class="optional">attributes=</span>, <span class="optional">metrics=</span>)</span><span class="type-signature"> &rarr; {<a href="AMA.Client.html#Event">AMA.Client.Event</a>}</span></h4> </dt> <dd> <div class="description"> Function to record a monetization event </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>monetizationDetails</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> </td> <td class="description last">Details about Monetization Event <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>currency</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">ISO Currency of event</td> </tr> <tr> <td class="name"><code>productId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Product Id of monetization event</td> </tr> <tr> <td class="name"><code>quantity</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Quantity of product in transaction</td> </tr> <tr> <td class="name"><code>price</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">number</span> </td> <td class="description last">Price of product either ISO formatted string, or number with associated ISO Currency</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>attributes=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Attributes">AMA.Client.Attributes</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Custom attributes</td> </tr> <tr> <td class="name"><code>metrics=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Client.html#Metrics">AMA.Client.Metrics</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Custom metrics</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line172">line 172</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The event that was recorded </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Client.html#Event">AMA.Client.Event</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="renewSession"><span class="type-signature"></span>renewSession<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="AMA.Session.html">AMA.Session</a>}</span></h4> </dt> <dd> <div class="description"> Function to stop the current session and start a new one </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line132">line 132</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The new Session Object for the SessionManager </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Session.html">AMA.Session</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="startSession"><span class="type-signature"></span>startSession<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="AMA.Client.html#Event">AMA.Client.Event</a>}</span></h4> </dt> <dd> <div class="description"> Function to start a session </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line86">line 86</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The start session event recorded </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Client.html#Event">AMA.Client.Event</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="stopSession"><span class="type-signature"></span>stopSession<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="AMA.Client.html#Event">AMA.Client.Event</a>}</span></h4> </dt> <dd> <div class="description"> Function to stop the current session </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line121">line 121</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The stop session event recorded </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="AMA.Client.html#Event">AMA.Client.Event</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="submitEvents"><span class="type-signature"></span>submitEvents<span class="signature">(<span class="optional">options=</span>)</span><span class="type-signature"> &rarr; {Array}</span></h4> </dt> <dd> <div class="description"> submitEvents </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options=</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last">options for submitting events</td> </tr> <tr> <td class="name"><code>options.clientContext</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> this.options.clientContext </td> <td class="description last">clientContext to submit with defaults to options.clientContext</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line78">line 78</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Array of batch indices that were submitted </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Type Definitions</h3> <dl> <dt> <h4 class="name" id="Options">Options</h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>expirationCallback=</code></td> <td class="type"> <span class="param-type"><a href="AMA.Session.html#ExpirationCallback">AMA.Session.ExpirationCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Callback function to call when sessions expire</td> </tr> </tbody> </table></dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MobileAnalyticsSessionManager.js.html">MobileAnalyticsSessionManager.js</a>, <a href="MobileAnalyticsSessionManager.js.html#line7">line 7</a> </li></ul></dd> </dl> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-AMA.html">AMA</a></li></ul><h3>Classes</h3><ul><li><a href="AMA.Client.html">Client</a></li><li><a href="AMA.Manager.html">Manager</a></li><li><a href="AMA.Session.html">Session</a></li></ul> </nav> <br clear="both"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Jul 19 2016 13:22:17 GMT-0700 (PDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>