Skip to content

Commit a712d82

Browse files
committed
update documentation
1 parent 6c25d58 commit a712d82

File tree

9 files changed

+48
-47
lines changed

9 files changed

+48
-47
lines changed

documentation/Amplitude.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,7 +3091,7 @@ <h5>Parameters:</h5>
30913091

30923092
<dt class="tag-source">Source:</dt>
30933093
<dd class="tag-source"><ul class="dummy"><li>
3094-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line871">line 871</a>
3094+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line872">line 872</a>
30953095
</li></ul></dd>
30963096

30973097

@@ -3137,7 +3137,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
31373137
<br class="clear">
31383138

31393139
<footer>
3140-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
3140+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
31413141
</footer>
31423142

31433143
<script> prettyPrint(); </script>

documentation/AmplitudeClient.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h4 class="name" id="__VERSION__"><span class="type-signature"></span>__VERSION_
185185

186186
<dt class="tag-source">Source:</dt>
187187
<dd class="tag-source"><ul class="dummy"><li>
188-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line1161">line 1161</a>
188+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line1162">line 1162</a>
189189
</li></ul></dd>
190190

191191

@@ -268,7 +268,7 @@ <h4 class="name" id="clearUserProperties"><span class="type-signature"></span>cl
268268

269269
<dt class="tag-source">Source:</dt>
270270
<dd class="tag-source"><ul class="dummy"><li>
271-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line702">line 702</a>
271+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line703">line 703</a>
272272
</li></ul></dd>
273273

274274

@@ -355,7 +355,7 @@ <h4 class="name" id="getSessionId"><span class="type-signature"></span>getSessio
355355

356356
<dt class="tag-source">Source:</dt>
357357
<dd class="tag-source"><ul class="dummy"><li>
358-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line250">line 250</a>
358+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line251">line 251</a>
359359
</li></ul></dd>
360360

361361

@@ -534,7 +534,7 @@ <h5>Parameters:</h5>
534534

535535
<dt class="tag-source">Source:</dt>
536536
<dd class="tag-source"><ul class="dummy"><li>
537-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line738">line 738</a>
537+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line739">line 739</a>
538538
</li></ul></dd>
539539

540540

@@ -829,7 +829,7 @@ <h4 class="name" id="isNewSession"><span class="type-signature"></span>isNewSess
829829

830830
<dt class="tag-source">Source:</dt>
831831
<dd class="tag-source"><ul class="dummy"><li>
832-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line241">line 241</a>
832+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line242">line 242</a>
833833
</li></ul></dd>
834834

835835

@@ -1029,7 +1029,7 @@ <h5>Parameters:</h5>
10291029

10301030
<dt class="tag-source">Source:</dt>
10311031
<dd class="tag-source"><ul class="dummy"><li>
1032-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line888">line 888</a>
1032+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line889">line 889</a>
10331033
</li></ul></dd>
10341034

10351035

@@ -1240,7 +1240,7 @@ <h5>Parameters:</h5>
12401240

12411241
<dt class="tag-source">Source:</dt>
12421242
<dd class="tag-source"><ul class="dummy"><li>
1243-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line914">line 914</a>
1243+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line915">line 915</a>
12441244
</li></ul></dd>
12451245

12461246

@@ -1424,7 +1424,7 @@ <h5>Parameters:</h5>
14241424

14251425
<dt class="tag-source">Source:</dt>
14261426
<dd class="tag-source"><ul class="dummy"><li>
1427-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line972">line 972</a>
1427+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line973">line 973</a>
14281428
</li></ul></dd>
14291429

14301430

@@ -1563,7 +1563,7 @@ <h5>Parameters:</h5>
15631563

15641564
<dt class="tag-source">Source:</dt>
15651565
<dd class="tag-source"><ul class="dummy"><li>
1566-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line943">line 943</a>
1566+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line944">line 944</a>
15671567
</li></ul></dd>
15681568

15691569

@@ -1654,7 +1654,7 @@ <h4 class="name" id="regenerateDeviceId"><span class="type-signature"></span>reg
16541654

16551655
<dt class="tag-source">Source:</dt>
16561656
<dd class="tag-source"><ul class="dummy"><li>
1657-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line642">line 642</a>
1657+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line643">line 643</a>
16581658
</li></ul></dd>
16591659

16601660

@@ -1787,7 +1787,7 @@ <h5>Parameters:</h5>
17871787

17881788
<dt class="tag-source">Source:</dt>
17891789
<dd class="tag-source"><ul class="dummy"><li>
1790-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line654">line 654</a>
1790+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line655">line 655</a>
17911791
</li></ul></dd>
17921792

17931793

@@ -1923,7 +1923,7 @@ <h5>Parameters:</h5>
19231923

19241924
<dt class="tag-source">Source:</dt>
19251925
<dd class="tag-source"><ul class="dummy"><li>
1926-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line559">line 559</a>
1926+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line560">line 560</a>
19271927
</li></ul></dd>
19281928

19291929

@@ -2012,7 +2012,7 @@ <h4 class="name" id="setGlobalUserProperties"><span class="type-signature"></spa
20122012

20132013
<dt class="tag-source">Source:</dt>
20142014
<dd class="tag-source"><ul class="dummy"><li>
2015-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line1151">line 1151</a>
2015+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line1152">line 1152</a>
20162016
</li></ul></dd>
20172017

20182018

@@ -2175,7 +2175,7 @@ <h5>Parameters:</h5>
21752175

21762176
<dt class="tag-source">Source:</dt>
21772177
<dd class="tag-source"><ul class="dummy"><li>
2178-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line604">line 604</a>
2178+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line605">line 605</a>
21792179
</li></ul></dd>
21802180

21812181

@@ -2311,7 +2311,7 @@ <h5>Parameters:</h5>
23112311

23122312
<dt class="tag-source">Source:</dt>
23132313
<dd class="tag-source"><ul class="dummy"><li>
2314-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line622">line 622</a>
2314+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line623">line 623</a>
23152315
</li></ul></dd>
23162316

23172317

@@ -2442,7 +2442,7 @@ <h5>Parameters:</h5>
24422442

24432443
<dt class="tag-source">Source:</dt>
24442444
<dd class="tag-source"><ul class="dummy"><li>
2445-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line582">line 582</a>
2445+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line583">line 583</a>
24462446
</li></ul></dd>
24472447

24482448

@@ -2602,7 +2602,7 @@ <h5>Parameters:</h5>
26022602

26032603
<dt class="tag-source">Source:</dt>
26042604
<dd class="tag-source"><ul class="dummy"><li>
2605-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line677">line 677</a>
2605+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line678">line 678</a>
26062606
</li></ul></dd>
26072607

26082608

@@ -2738,7 +2738,7 @@ <h5>Parameters:</h5>
27382738

27392739
<dt class="tag-source">Source:</dt>
27402740
<dd class="tag-source"><ul class="dummy"><li>
2741-
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line773">line 773</a>
2741+
<a href="amplitude-client.js.html">amplitude-client.js</a>, <a href="amplitude-client.js.html#line774">line 774</a>
27422742
</li></ul></dd>
27432743

27442744

@@ -2791,7 +2791,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
27912791
<br class="clear">
27922792

27932793
<footer>
2794-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
2794+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
27952795
</footer>
27962796

27972797
<script> prettyPrint(); </script>

documentation/Identify.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
12951295
<br class="clear">
12961296

12971297
<footer>
1298-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
1298+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
12991299
</footer>
13001300

13011301
<script> prettyPrint(); </script>

documentation/Revenue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
965965
<br class="clear">
966966

967967
<footer>
968-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
968+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
969969
</footer>
970970

971971
<script> prettyPrint(); </script>

documentation/amplitude-client.js.html

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,7 @@ <h1 class="page-title">Source: amplitude-client.js</h1>
113113
this.options.userId = (type(opt_userId) === 'string' &amp;&amp; !utils.isEmptyString(opt_userId) &amp;&amp; opt_userId) ||
114114
this.options.userId || null;
115115

116-
var now = new Date().getTime();
117-
if (!this._sessionId || !this._lastEventTime || now - this._lastEventTime > this.options.sessionTimeout) {
118-
this._newSession = true;
119-
this._sessionId = now;
120-
121-
// only capture UTM params and referrer if new session
122-
if (this.options.saveParamsReferrerOncePerSession) {
123-
this._trackParamsAndReferrer();
124-
}
125-
}
126-
127-
if (!this.options.saveParamsReferrerOncePerSession) {
128-
this._trackParamsAndReferrer();
129-
}
130-
131-
this._lastEventTime = now;
132-
_saveCookieData(this);
133-
116+
// load unsent events and identifies before any attempt to log new ones
134117
if (this.options.saveEvents) {
135118
this._unsentEvents = this._loadSavedUnsentEvents(this.options.unsentKey);
136119
this._unsentIdentifys = this._loadSavedUnsentEvents(this.options.unsentIdentifyKey);
@@ -150,9 +133,27 @@ <h1 class="page-title">Source: amplitude-client.js</h1>
150133
this._unsentIdentifys[j].user_properties = utils.validateProperties(userProperties);
151134
this._unsentIdentifys[j].groups = utils.validateGroups(identifyGroups);
152135
}
136+
}
137+
138+
var now = new Date().getTime();
139+
if (!this._sessionId || !this._lastEventTime || now - this._lastEventTime > this.options.sessionTimeout) {
140+
this._newSession = true;
141+
this._sessionId = now;
142+
143+
// only capture UTM params and referrer if new session
144+
if (this.options.saveParamsReferrerOncePerSession) {
145+
this._trackParamsAndReferrer();
146+
}
147+
}
153148

154-
this._sendEventsIfReady(); // try sending unsent events
149+
if (!this.options.saveParamsReferrerOncePerSession) {
150+
this._trackParamsAndReferrer();
155151
}
152+
153+
this._lastEventTime = now;
154+
_saveCookieData(this);
155+
156+
this._sendEventsIfReady(); // try sending unsent events
156157
} catch (e) {
157158
utils.log(e);
158159
} finally {
@@ -1205,7 +1206,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
12051206
<br class="clear">
12061207

12071208
<footer>
1208-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
1209+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
12091210
</footer>
12101211

12111212
<script> prettyPrint(); </script>

documentation/amplitude.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
409409
<br class="clear">
410410

411411
<footer>
412-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
412+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
413413
</footer>
414414

415415
<script> prettyPrint(); </script>

documentation/identify.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
226226
<br class="clear">
227227

228228
<footer>
229-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
229+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
230230
</footer>
231231

232232
<script> prettyPrint(); </script>

documentation/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
5656
<br class="clear">
5757

5858
<footer>
59-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
59+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
6060
</footer>
6161

6262
<script> prettyPrint(); </script>

documentation/revenue.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Amplitude
196196
<br class="clear">
197197

198198
<footer>
199-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 19 2016 00:42:27 GMT-0700 (PDT)
199+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Oct 26 2016 12:13:53 GMT-0700 (PDT)
200200
</footer>
201201

202202
<script> prettyPrint(); </script>

0 commit comments

Comments
 (0)