From 0934c80facff422e89d5d304be32b4d4b5716c2e Mon Sep 17 00:00:00 2001 From: Jarren Patao Date: Thu, 27 May 2021 17:06:42 -0700 Subject: [PATCH 1/3] Added example and description for setSessionId method --- src/amplitude-client.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index e031a684..2d2938d7 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -939,6 +939,14 @@ AmplitudeClient.prototype.setOptOut = function setOptOut(enable) { } }; +/** + * Set a custom Session ID for the current session. + * Note: This is not recommended unless you know what you are doing because the Session ID of a session is utilized for all session metrics in Amplitude. + * The Session ID to set for the current session must be in milliseconds since epoch (Unix Timestamp). + * @public + * @param {int} sessionId to set. + * @example amplitudeClient.setSessionId(1622158968000); + */ AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) { if (!utils.validateInput(sessionId, 'sessionId', 'number')) { return; From 259432391bbd8106eb1b60bbfb82b211c31771e0 Mon Sep 17 00:00:00 2001 From: Jarren Patao Date: Thu, 27 May 2021 17:28:04 -0700 Subject: [PATCH 2/3] Pulled off master to update to latest version --- src/amplitude-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index d96ea87c..059a7d5e 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -957,7 +957,7 @@ AmplitudeClient.prototype.setGroup = function (groupType, groupName) { * @param {boolean} enable - if true then no events will be logged or sent. * @example: amplitude.setOptOut(true); */ -AmplitudeClient.prototype.setOptOut = function setOptOut(enable) { +AmplitudeClient.prototype.setOptOu = function setOptOut(enable) { if (this._shouldDeferCall()) { return this._q.push(['setOptOut'].concat(Array.prototype.slice.call(arguments, 0))); } From b0e7915111079097aaef52efdd7153e4981af39e Mon Sep 17 00:00:00 2001 From: Jarren Patao Date: Thu, 27 May 2021 17:33:31 -0700 Subject: [PATCH 3/3] Fixing accidental deletion of a letter for setOptOut --- src/amplitude-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amplitude-client.js b/src/amplitude-client.js index 059a7d5e..d96ea87c 100644 --- a/src/amplitude-client.js +++ b/src/amplitude-client.js @@ -957,7 +957,7 @@ AmplitudeClient.prototype.setGroup = function (groupType, groupName) { * @param {boolean} enable - if true then no events will be logged or sent. * @example: amplitude.setOptOut(true); */ -AmplitudeClient.prototype.setOptOu = function setOptOut(enable) { +AmplitudeClient.prototype.setOptOut = function setOptOut(enable) { if (this._shouldDeferCall()) { return this._q.push(['setOptOut'].concat(Array.prototype.slice.call(arguments, 0))); }