@constructor-io/constructorio-client-javascript 2.48.0 → 2.49.0

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.
@@ -1093,12 +1093,19 @@ var Tracker = /*#__PURE__*/function () {
1093
1093
  orderId = _parameters$orderId === void 0 ? order_id : _parameters$orderId,
1094
1094
  section = parameters.section,
1095
1095
  analyticsTags = parameters.analyticsTags;
1096
+ var apiKey = this.options.apiKey;
1096
1097
  if (orderId) {
1097
- // Don't send another purchase event if we have already tracked the order
1098
- if (helpers.hasOrderIdRecord(orderId)) {
1098
+ // Don't send another purchase event if we have already tracked the order for the current key
1099
+ if (helpers.hasOrderIdRecord({
1100
+ orderId: orderId,
1101
+ apiKey: apiKey
1102
+ })) {
1099
1103
  return false;
1100
1104
  }
1101
- helpers.addOrderIdRecord(orderId);
1105
+ helpers.addOrderIdRecord({
1106
+ orderId: orderId,
1107
+ apiKey: apiKey
1108
+ });
1102
1109
 
1103
1110
  // Add order_id to the tracking params
1104
1111
  bodyParams.order_id = orderId;
@@ -104,8 +104,12 @@ var utils = {
104
104
  }
105
105
  return null;
106
106
  },
107
- hasOrderIdRecord: function hasOrderIdRecord(orderId) {
108
- var orderIdHash = CRC32.str(orderId.toString());
107
+ hasOrderIdRecord: function hasOrderIdRecord(_ref) {
108
+ var orderId = _ref.orderId,
109
+ apiKey = _ref.apiKey;
110
+ var orderPerKeyId = orderId;
111
+ if (apiKey) orderPerKeyId = "".concat(apiKey, "-").concat(orderId);
112
+ var orderIdHash = CRC32.str(orderPerKeyId.toString());
109
113
  var purchaseEventStorage = store.local.get(purchaseEventStorageKey);
110
114
  if (typeof purchaseEventStorage === 'string') {
111
115
  purchaseEventStorage = JSON.parse(purchaseEventStorage);
@@ -115,8 +119,12 @@ var utils = {
115
119
  }
116
120
  return null;
117
121
  },
118
- addOrderIdRecord: function addOrderIdRecord(orderId) {
119
- var orderIdHash = CRC32.str(orderId.toString());
122
+ addOrderIdRecord: function addOrderIdRecord(_ref2) {
123
+ var orderId = _ref2.orderId,
124
+ apiKey = _ref2.apiKey;
125
+ var orderPerKeyId = orderId;
126
+ if (apiKey) orderPerKeyId = "".concat(apiKey, "-").concat(orderId);
127
+ var orderIdHash = CRC32.str(orderPerKeyId.toString());
120
128
  var purchaseEventStorage = store.local.get(purchaseEventStorageKey);
121
129
  if (typeof purchaseEventStorage === 'string') {
122
130
  purchaseEventStorage = JSON.parse(purchaseEventStorage);
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.48.0';
7
+ var _default = '2.49.0';
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.48.0",
3
+ "version": "2.49.0",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/index.d.ts",