API Docs for: 2.18.0
Show:

mParticle.Identity.getCurrentUser() Class

Defined in: src/identity.js:763

Invoke these methods on the mParticle.Identity.getCurrentUser() object. Example: mParticle.Identity.getCurrentUser().getAllUserAttributes()

Methods

getAllUserAttributes

() Object

Returns all user attributes

Returns:

Object:

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

Defined in src/identity.js:797

Get the MPID of the current user

Returns:

String:

the current user MPID as a string

getUserAttributesLists

() Object

Returns all user attribute keys that have values that are arrays

Returns:

Object:

an object of only keys with array values. Example: { attr1: [1, 2, 3], attr2: ['a', 'b', 'c'] }

getUserIdentities

() Object

Defined in src/identity.js:771

Get user identities for current user

Returns:

Object:

an object with userIdentities as its key

removeAllUserAttributes

()

Removes all user attributes

removeUserAttribute

(
  • key
)

Defined in src/identity.js:936

Removes a specific user attribute

Parameters:

  • key String

removeUserTag

(
  • tagName
)

Defined in src/identity.js:818

Removes a user tag

Parameters:

  • tagName String

setConsentState

(
  • consent
)

Sets the Consent State stored locally for this user.

Parameters:

  • consent Object

    state

setUserAttribute

(
  • key
  • value
)

Defined in src/identity.js:831

Sets a user attribute

Parameters:

  • key String
  • value String

setUserAttributeList

(
  • key
  • value
)

Defined in src/identity.js:999

Sets a list of user attributes

Parameters:

  • key String
  • value Array

    an array of values

setUserAttributes

(
  • user
)

Defined in src/identity.js:914

Set multiple user attributes

Parameters:

  • user Object

    attribute object with keys of the attribute type, and value of the attribute value

setUserTag

(
  • tagName
)

Defined in src/identity.js:805

Sets a user tag

Parameters:

  • tagName String