|
2 | 2 | import Constants from './constants'; |
3 | 3 | import cookieStorage from './cookiestorage'; |
4 | 4 | import MetadataStorage from '../src/metadata-storage'; |
5 | | -import getUtmData from './utm'; // Urchin Tracking Module |
| 5 | +import getUtmData from './utm'; // Urchin Tracking Module |
6 | 6 | import Identify from './identify'; |
7 | 7 | import localStorage from './localstorage'; // jshint ignore:line |
8 | 8 | import md5 from 'blueimp-md5'; |
@@ -493,7 +493,7 @@ AmplitudeClient.prototype.isNewSession = function isNewSession() { |
493 | 493 | */ |
494 | 494 | AmplitudeClient.prototype.onInit = function (callback) { |
495 | 495 | if (this._isInitialized) { |
496 | | - callback(); |
| 496 | + callback(this); |
497 | 497 | } else { |
498 | 498 | this._onInit.push(callback); |
499 | 499 | } |
@@ -874,12 +874,12 @@ AmplitudeClient.prototype.setUserId = function setUserId(userId) { |
874 | 874 |
|
875 | 875 | /** |
876 | 876 | * Add user to a group or groups. You need to specify a groupType and groupName(s). |
877 | | - * |
| 877 | + * |
878 | 878 | * For example you can group people by their organization. |
879 | 879 | * In that case, groupType is "orgId" and groupName would be the actual ID(s). |
880 | 880 | * groupName can be a string or an array of strings to indicate a user in multiple gruups. |
881 | 881 | * You can also call setGroup multiple times with different groupTypes to track multiple types of groups (up to 5 per app). |
882 | | - * |
| 882 | + * |
883 | 883 | * Note: this will also set groupType: groupName as a user property. |
884 | 884 | * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information. |
885 | 885 | * @public |
@@ -1362,7 +1362,7 @@ AmplitudeClient.prototype.logEventWithTimestamp = function logEvent(eventType, e |
1362 | 1362 | * Log an event with eventType, eventProperties, and groups. Use this to set event-level groups. |
1363 | 1363 | * Note: the group(s) set only apply for the specific event type being logged and does not persist on the user |
1364 | 1364 | * (unless you explicitly set it with setGroup). |
1365 | | - * |
| 1365 | + * |
1366 | 1366 | * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information. |
1367 | 1367 | * about groups and Count by Distinct on the Amplitude platform. |
1368 | 1368 | * @public |
@@ -1404,7 +1404,7 @@ var _isNumber = function _isNumber(n) { |
1404 | 1404 | /** |
1405 | 1405 | * Log revenue with Revenue interface. The new revenue interface allows for more revenue fields like |
1406 | 1406 | * revenueType and event properties. |
1407 | | - * |
| 1407 | + * |
1408 | 1408 | * See the [Revenue](https://amplitude.github.io/Amplitude-JavaScript/Revenue/) |
1409 | 1409 | * reference page for more information on the Revenue interface and logging revenue. |
1410 | 1410 | * @public |
@@ -1487,7 +1487,7 @@ var _removeEvents = function _removeEvents(scope, eventQueue, maxId, status, res |
1487 | 1487 |
|
1488 | 1488 | var filteredEvents = []; |
1489 | 1489 | for (var i = 0; i < scope[eventQueue].length || 0; i++) { |
1490 | | - const unsentEvent = scope[eventQueue][i]; |
| 1490 | + const unsentEvent = scope[eventQueue][i]; |
1491 | 1491 |
|
1492 | 1492 | if (unsentEvent.event.event_id > maxId) { |
1493 | 1493 | filteredEvents.push(unsentEvent); |
|
0 commit comments