apps-sdk 1.1.5 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -81,8 +81,10 @@ class MixPanel {
81
81
  if (!this.devMode) {
82
82
  const trackingPermissionAnswered = await Storage.getData('TRACKING_PERMISSION_ANSWERED');
83
83
  if (config.TRACKING_ACTIVE || !trackingPermissionAnswered) {
84
- await this.mixpanel.registerSuperProperties(properties);
85
- config.DEBUG_MODE && console.log('MixPanel Super Properties registered:', properties);
84
+ const distinctId = await this.getDistinctID();
85
+ const superProperties = { ...properties, distinct_id: distinctId };
86
+ await this.mixpanel.registerSuperProperties(superProperties);
87
+ config.DEBUG_MODE && console.log('MixPanel Super Properties registered:', superProperties);
86
88
  } else {
87
89
  config.DEBUG_MODE && console.log('MixPanel Super Properties not registered due to tracking permission:', properties);
88
90
  }
@@ -102,8 +104,10 @@ class MixPanel {
102
104
 
103
105
  try {
104
106
  if (!this.devMode) {
105
- await this.mixpanel.registerSuperPropertiesOnce(properties);
106
- config.DEBUG_MODE && console.log('MixPanel Super Properties appended:', properties);
107
+ const distinctId = await this.getDistinctID();
108
+ const superProperties = { ...properties, distinct_id: distinctId };
109
+ await this.mixpanel.registerSuperPropertiesOnce(superProperties);
110
+ config.DEBUG_MODE && console.log('MixPanel Super Properties appended:', superProperties);
107
111
  } else {
108
112
  config.DEBUG_MODE && console.log('MixPanel Super Properties appended but not send (DEV_MODE ON):', properties);
109
113
  }
@@ -138,8 +142,10 @@ class MixPanel {
138
142
 
139
143
  try {
140
144
  if (!this.devMode) {
141
- await this.mixpanel.getPeople().set(propertyName, propertyValue);
142
- config.DEBUG_MODE && console.log(`MixPanel User property set: ${propertyName} = ${propertyValue}`);
145
+ const distinctId = await this.getDistinctID();
146
+ const userProperties = { [propertyName]: propertyValue, distinct_id: distinctId };
147
+ await this.mixpanel.getPeople().set(userProperties);
148
+ config.DEBUG_MODE && console.log(`MixPanel User property set: ${propertyName} = ${propertyValue}, distinct_id = ${distinctId}`);
143
149
  } else {
144
150
  config.DEBUG_MODE && console.log(`MixPanel User property set but not send (DEV_MODE ON): ${propertyName} = ${propertyValue}`);
145
151
  }