@kameleoon/javascript-sdk-core
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -102,3 +102,12 @@ "use strict"; | ||
} | ||
const userAgent = _utilities.Utilities.getUserAgent(visitorCode, this.campaignConfiguration); | ||
const dataUrl = _utilities.Utilities.getDataUrl(visitorCode, this.campaignConfiguration); | ||
const targetingData = this.campaignConfiguration.storedTargetingData[visitorCode]; | ||
const trackingParameters = { | ||
body: dataUrl, | ||
visitorCode, | ||
experimentId | ||
}; | ||
let variationId = _constants.UNALLOCATED_VARIATION_ID; | ||
let isUnallocated = true; | ||
const targetingResult = _utilities.Utilities.checkTargeting({ | ||
@@ -111,17 +120,7 @@ visitorCode, | ||
}).throw(); | ||
if (!targetingResult) { | ||
throw new _kameleoonError.KameleoonError(_kameleoonError.KameleoonException.NotTargeted, visitorCode); | ||
} | ||
const dataUrl = _utilities.Utilities.getDataUrl(visitorCode, this.campaignConfiguration); | ||
const trackingParameters = { | ||
body: dataUrl, | ||
visitorCode, | ||
experimentId | ||
}; | ||
const userAgent = _utilities.Utilities.getUserAgent(visitorCode, this.campaignConfiguration); | ||
const variationId = this.variationConfiguration.getAssociatedVariationId(visitorCode, experimentId).else(error => { | ||
variationId = this.variationConfiguration.getAssociatedVariationId(visitorCode, experimentId).else(error => { | ||
if (error.type === _kameleoonError.KameleoonException.NotAllocated) { | ||
this.requester.trackExperiment(_objectSpread({ | ||
variationId: _constants.UNALLOCATED_VARIATION_ID, | ||
isUnallocated: true, | ||
variationId, | ||
userAgent | ||
@@ -135,5 +134,8 @@ }, trackingParameters)); | ||
variationId, | ||
isUnallocated: false, | ||
isUnallocated, | ||
userAgent | ||
}, trackingParameters)); | ||
if (!targetingResult) { | ||
throw new _kameleoonError.KameleoonError(_kameleoonError.KameleoonException.NotTargeted, visitorCode); | ||
} | ||
_utilities.Utilities.updateCache({ | ||
@@ -140,0 +142,0 @@ cacheManager: this.trackingCache, |
@@ -72,3 +72,3 @@ "use strict"; | ||
const resultVariationId = variationId || 0; | ||
const isUnallocated = !variationId; | ||
const isUnallocated = variationId === null; | ||
const callback = () => campaignConfiguration.clearUnsentData; | ||
@@ -75,0 +75,0 @@ requester.trackExperiment({ |
@@ -103,3 +103,3 @@ "use strict"; | ||
}); | ||
if (ruleHash < exposition) { | ||
if (ruleHash <= exposition) { | ||
let totalDeviation = 0; | ||
@@ -106,0 +106,0 @@ const variationHash = _hasher.Hasher.obtainFeatureFlagHashDouble({ |
{ | ||
"name": "@kameleoon/javascript-sdk-core", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Kameleoon JS SDK Core", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
474632
5416