Skip to content

fix(nullattributes): track and activate should not remove null attributes. #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 24, 2018
8 changes: 2 additions & 6 deletions packages/optimizely-sdk/lib/optimizely/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ Optimizely.prototype.activate = function (experimentKey, userId, attributes) {
this.logger.log(LOG_LEVEL.DEBUG, shouldNotDispatchActivateLogMessage);
return variationKey;
}

// remove null values from attributes
attributes = this.__filterEmptyValues(attributes);


this._sendImpressionEvent(experimentKey, variationKey, userId, attributes);

return variationKey;
Expand Down Expand Up @@ -238,8 +235,7 @@ Optimizely.prototype.track = function(eventKey, userId, attributes, eventTags) {
return;
}

// remove null values from attributes and eventTags
attributes = this.__filterEmptyValues(attributes);
// remove null values from eventTags
eventTags = this.__filterEmptyValues(eventTags);

var conversionEventOptions = {
Expand Down