@constructor-io/constructorio-client-javascript 2.64.1 → 2.64.3

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.
@@ -7,6 +7,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
7
7
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
+ /* eslint-disable max-depth */
10
11
  /* eslint-disable complexity */
11
12
  /* eslint-disable max-len */
12
13
  /* eslint-disable object-curly-newline, no-underscore-dangle, camelcase, no-unneeded-ternary */
@@ -25,7 +26,8 @@ function applyParams(parameters, options) {
25
26
  beaconMode = options.beaconMode;
26
27
  var _helpers$getWindowLoc = helpers.getWindowLocation(),
27
28
  host = _helpers$getWindowLoc.host,
28
- pathname = _helpers$getWindowLoc.pathname;
29
+ pathname = _helpers$getWindowLoc.pathname,
30
+ search = _helpers$getWindowLoc.search;
29
31
  var sendReferrerWithTrackingEvents = options.sendReferrerWithTrackingEvents === false ? false : true; // Defaults to 'true'
30
32
  var aggregateParams = Object.assign(parameters);
31
33
  if (version) {
@@ -59,6 +61,22 @@ function applyParams(parameters, options) {
59
61
  if (pathname) {
60
62
  aggregateParams.origin_referrer += pathname;
61
63
  }
64
+ if (search) {
65
+ try {
66
+ var utmQueryParamStrArr = [];
67
+ var searchParams = new URLSearchParams(search);
68
+ searchParams.forEach(function (value, key) {
69
+ if (key.match(/utm_/)) {
70
+ utmQueryParamStrArr.push("".concat(key, "=").concat(value));
71
+ }
72
+ });
73
+ if (utmQueryParamStrArr.length) {
74
+ aggregateParams.origin_referrer += "?".concat(utmQueryParamStrArr.join('&'));
75
+ }
76
+ } catch (e) {
77
+ // Do nothing
78
+ }
79
+ }
62
80
  }
63
81
  aggregateParams._dt = Date.now();
64
82
  aggregateParams = helpers.cleanParams(aggregateParams);
@@ -240,9 +240,9 @@ export interface ItemTracked {
240
240
  variationId?: string;
241
241
  slCampaignId?: string;
242
242
  slCampaignOwner?: string;
243
+ price?: number;
243
244
  }
244
245
 
245
246
  export interface ItemTrackedPurchase extends ItemTracked {
246
247
  count?: number;
247
- price?: number;
248
248
  }
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _default = '2.64.1';
7
+ var _default = '2.64.3';
8
8
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-client-javascript",
3
- "version": "2.64.1",
3
+ "version": "2.64.3",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/index.d.ts",