zar 0.1.0 → 0.1.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/dist/zar.es.js CHANGED
@@ -3741,12 +3741,6 @@ function setSessionStorage(key, value) {
3741
3741
  }
3742
3742
  zarGlobal[key] = value_str;
3743
3743
  }
3744
- function removeSessionStorage(key) {
3745
- if (supportsSessionStorage) {
3746
- sessionStorage.removeItem(key);
3747
- }
3748
- delete zarGlobal[key];
3749
- }
3750
3744
  function hasAdBlock() {
3751
3745
  var fakeAd = document.createElement("div");
3752
3746
  fakeAd.innerHTML = " ";
@@ -3904,12 +3898,6 @@ function getIDs() {
3904
3898
  vid: getID(VID_KEY)
3905
3899
  };
3906
3900
  }
3907
- function removeID(key) {
3908
- removeSessionStorage(key);
3909
- }
3910
- function removeIDs() {
3911
- removeID(VID_KEY);
3912
- }
3913
3901
  function extractPhoneNumber({ elem }) {
3914
3902
  var numberText = null;
3915
3903
  var number = null;
@@ -4142,6 +4130,7 @@ function initTrackingPool() {
4142
4130
  });
4143
4131
  }
4144
4132
  function zar({ apiUrl, poolConfig }) {
4133
+ initIDs();
4145
4134
  return {
4146
4135
  name: "zar",
4147
4136
  config: { apiUrl, poolConfig },
@@ -4163,8 +4152,12 @@ function zar({ apiUrl, poolConfig }) {
4163
4152
  if ("search" in payload.properties) {
4164
4153
  delete payload.properties["search"];
4165
4154
  }
4166
- if (config2.poolConfig && config2.poolConfig.poolId) {
4167
- payload.properties.pool_id = getPoolId(config2.poolConfig.poolId);
4155
+ var pcfg = config2.poolConfig;
4156
+ if (pcfg && pcfg.poolId) {
4157
+ payload.properties.pool_id = getPoolId(pcfg.poolId);
4158
+ if (pcfg.contextCallback) {
4159
+ payload.properties.pool_context = pcfg.contextCallback() || {};
4160
+ }
4168
4161
  }
4169
4162
  return payload;
4170
4163
  },
@@ -4187,12 +4180,6 @@ function zar({ apiUrl, poolConfig }) {
4187
4180
  dbg("track", payload);
4188
4181
  httpPost({ url: `${config2.apiUrl}/track`, data: payload, beacon: true });
4189
4182
  },
4190
- reset: function({ instance }) {
4191
- removeIDs();
4192
- },
4193
- bootstrap: function({ payload, config: config2, instance }) {
4194
- initIDs();
4195
- },
4196
4183
  methods: {
4197
4184
  apiUrl() {
4198
4185
  return apiUrl;