@constructor-io/constructorio-client-javascript 2.66.0 → 2.66.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modules/tracker.js +6 -5
- package/lib/utils/helpers.js +3 -0
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/modules/tracker.js
CHANGED
|
@@ -14,6 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
var EventEmitter = require('../utils/events');
|
|
15
15
|
var helpers = require('../utils/helpers');
|
|
16
16
|
var RequestQueue = require('../utils/request-queue');
|
|
17
|
+
var MAX_URL_LENGTH = 2048;
|
|
17
18
|
function applyParams(parameters, options) {
|
|
18
19
|
var apiKey = options.apiKey,
|
|
19
20
|
version = options.version,
|
|
@@ -271,7 +272,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
271
272
|
bodyParams.analytics_tags = analyticsTags;
|
|
272
273
|
}
|
|
273
274
|
if (url) {
|
|
274
|
-
bodyParams.url = url;
|
|
275
|
+
bodyParams.url = helpers.truncateString(url, MAX_URL_LENGTH);
|
|
275
276
|
}
|
|
276
277
|
var requestURL = "".concat(requestUrlPath).concat(applyParamsAsString(queryParams, this.options));
|
|
277
278
|
var requestMethod = 'POST';
|
|
@@ -724,7 +725,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
724
725
|
sort_order: sortOrder,
|
|
725
726
|
sort_by: sortBy,
|
|
726
727
|
selected_filters: selectedFilters,
|
|
727
|
-
url: url,
|
|
728
|
+
url: helpers.truncateString(url, MAX_URL_LENGTH),
|
|
728
729
|
section: section,
|
|
729
730
|
analytics_tags: analyticsTags
|
|
730
731
|
};
|
|
@@ -1240,7 +1241,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
1240
1241
|
bodyParams.section = 'Products';
|
|
1241
1242
|
}
|
|
1242
1243
|
if (url) {
|
|
1243
|
-
bodyParams.url = url;
|
|
1244
|
+
bodyParams.url = helpers.truncateString(url, MAX_URL_LENGTH);
|
|
1244
1245
|
}
|
|
1245
1246
|
if (podId) {
|
|
1246
1247
|
bodyParams.pod_id = podId;
|
|
@@ -1494,7 +1495,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
1494
1495
|
bodyParams.selected_filters = selectedFilters;
|
|
1495
1496
|
}
|
|
1496
1497
|
if (url) {
|
|
1497
|
-
bodyParams.url = url;
|
|
1498
|
+
bodyParams.url = helpers.truncateString(url, MAX_URL_LENGTH);
|
|
1498
1499
|
}
|
|
1499
1500
|
if (sortOrder) {
|
|
1500
1501
|
bodyParams.sort_order = sortOrder;
|
|
@@ -1926,7 +1927,7 @@ var Tracker = /*#__PURE__*/function () {
|
|
|
1926
1927
|
bodyParams.quiz_id = quizId;
|
|
1927
1928
|
bodyParams.quiz_version_id = quizVersionId;
|
|
1928
1929
|
bodyParams.quiz_session_id = quizSessionId;
|
|
1929
|
-
bodyParams.url = url;
|
|
1930
|
+
bodyParams.url = helpers.truncateString(url, MAX_URL_LENGTH);
|
|
1930
1931
|
if (!helpers.isNil(section)) {
|
|
1931
1932
|
if (typeof section !== 'string') {
|
|
1932
1933
|
return new Error('"section" must be a string');
|
package/lib/utils/helpers.js
CHANGED
package/lib/version.js
CHANGED