@@ -18,11 +18,11 @@ var moduleId = 181;
1818
1919var constructor = function ( ) {
2020 var self = this ;
21- var EMAIL_SHA256_IDENTITY = 'emailsha256' ;
22- var EMAIL_IDENTITY = 'email' ;
21+ var EMAIL_SHA256_KEY = 'emailsha256' ;
22+ var EMAIL_KEY = 'email' ;
2323
24- // Dynamic identity type for Rokt's emailsha256 identity value which MP doesn't support - will be set during initialization
25- var OTHER_IDENTITY ;
24+ // Dynamic identity type for Rokt's emailsha256 identity value which MP doesn't natively support - will be set during initialization
25+ var MAPPED_EMAIL_SHA256_IDENTITY ;
2626
2727 self . name = name ;
2828 self . moduleId = moduleId ;
@@ -91,7 +91,8 @@ var constructor = function () {
9191 // Set dynamic OTHER_IDENTITY based on server settings
9292 // Convert to lowercase since server sends TitleCase (e.g., 'Other' -> 'other')
9393 if ( settings . hashedEmailUserIdentityType ) {
94- OTHER_IDENTITY = settings . hashedEmailUserIdentityType . toLowerCase ( ) ;
94+ MAPPED_EMAIL_SHA256_IDENTITY =
95+ settings . hashedEmailUserIdentityType . toLowerCase ( ) ;
9596 }
9697
9798 var domain = window . mParticle . Rokt . domain ;
@@ -177,19 +178,19 @@ var constructor = function () {
177178
178179 function replaceOtherIdentityWithEmailsha256 ( userIdentities ) {
179180 var newUserIdentities = mergeObjects ( { } , userIdentities || { } ) ;
180- if ( userIdentities . hasOwnProperty ( OTHER_IDENTITY ) ) {
181- newUserIdentities [ EMAIL_SHA256_IDENTITY ] =
182- userIdentities [ OTHER_IDENTITY ] ;
183- delete newUserIdentities [ OTHER_IDENTITY ] ;
181+ if ( userIdentities . hasOwnProperty ( MAPPED_EMAIL_SHA256_IDENTITY ) ) {
182+ newUserIdentities [ EMAIL_SHA256_KEY ] =
183+ userIdentities [ MAPPED_EMAIL_SHA256_IDENTITY ] ;
184+ delete newUserIdentities [ MAPPED_EMAIL_SHA256_IDENTITY ] ;
184185 }
185186
186187 return newUserIdentities ;
187188 }
188189
189190 function sanitizeIdentities ( _data ) {
190191 var data = mergeObjects ( { } , _data || { } ) ;
191- if ( _data . hasOwnProperty ( EMAIL_SHA256_IDENTITY ) ) {
192- delete data [ EMAIL_IDENTITY ] ;
192+ if ( _data . hasOwnProperty ( EMAIL_SHA256_KEY ) ) {
193+ delete data [ EMAIL_KEY ] ;
193194 }
194195
195196 return data ;
0 commit comments