Skip to content

Commit 346f554

Browse files
authored
fix: Ignore false-y identity values and remove email sanitization (#51)
1 parent 725805b commit 346f554

File tree

2 files changed

+806
-14
lines changed

2 files changed

+806
-14
lines changed

src/Rokt-Kit.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var constructor = function () {
2323
};
2424

2525
var EMAIL_SHA256_KEY = 'emailsha256';
26-
var EMAIL_KEY = 'email';
2726

2827
// Dynamic identity type for Rokt's emailsha256 identity value which MP doesn't natively support - will be set during initialization
2928
var mappedEmailSha256Key;
@@ -185,24 +184,15 @@ var constructor = function () {
185184

186185
function replaceOtherIdentityWithEmailsha256(userIdentities) {
187186
var newUserIdentities = mergeObjects({}, userIdentities || {});
188-
if (userIdentities.hasOwnProperty(mappedEmailSha256Key)) {
187+
if (userIdentities[mappedEmailSha256Key]) {
189188
newUserIdentities[EMAIL_SHA256_KEY] =
190189
userIdentities[mappedEmailSha256Key];
191-
delete newUserIdentities[mappedEmailSha256Key];
192190
}
191+
delete newUserIdentities[mappedEmailSha256Key];
193192

194193
return newUserIdentities;
195194
}
196195

197-
function sanitizeEmailIdentities(_data) {
198-
var data = mergeObjects({}, _data || {});
199-
if (_data.hasOwnProperty(EMAIL_SHA256_KEY)) {
200-
delete data[EMAIL_KEY];
201-
}
202-
203-
return data;
204-
}
205-
206196
/**
207197
* Selects placements for Rokt Web SDK with merged attributes, filters, and experimentation options
208198
* @see https://docs.rokt.com/developers/integration-guides/web/library/select-placements-options/
@@ -262,7 +252,7 @@ var constructor = function () {
262252
);
263253

264254
var selectPlacementsOptions = mergeObjects(options, {
265-
attributes: sanitizeEmailIdentities(selectPlacementsAttributes),
255+
attributes: selectPlacementsAttributes,
266256
});
267257

268258
return self.launcher.selectPlacements(selectPlacementsOptions);

0 commit comments

Comments
 (0)