mParticle.Identity.getCurrentUser() Class
Invoke these methods on the mParticle.Identity.getCurrentUser() object. Example: mParticle.Identity.getCurrentUser().getAllUserAttributes()
Item Index
Methods
getAllUserAttributes
()
Object
Returns all user attributes
Returns:
an object of all user attributes. Example: { attr1: 'value1', attr2: ['a', 'b', 'c'] }
getCart
()
Returns the cart object for the current user
Returns:
a cart object
getConsentState
()
Returns the Consent State stored locally for this user.
Returns:
a ConsentState object
getMPID
()
String
Get the MPID of the current user
Returns:
the current user MPID as a string
getUserAttributesLists
()
Object
Returns all user attribute keys that have values that are arrays
Returns:
an object of only keys with array values. Example: { attr1: [1, 2, 3], attr2: ['a', 'b', 'c'] }
getUserIdentities
()
Object
Get user identities for current user
Returns:
an object with userIdentities as its key
removeAllUserAttributes
()
Removes all user attributes
removeUserAttribute
-
key
Removes a specific user attribute
Parameters:
-
key
String
removeUserTag
-
tagName
Removes a user tag
Parameters:
-
tagName
String
setConsentState
-
consent
Sets the Consent State stored locally for this user.
Parameters:
-
consent
Objectstate
setUserAttribute
-
key
-
value
Sets a user attribute
Parameters:
-
key
String -
value
String
setUserAttributeList
-
key
-
value
Sets a list of user attributes
Parameters:
-
key
String -
value
Arrayan array of values
setUserAttributes
-
user
Set multiple user attributes
Parameters:
-
user
Objectattribute object with keys of the attribute type, and value of the attribute value
setUserTag
-
tagName
Sets a user tag
Parameters:
-
tagName
String