API Docs for: 2.18.0
Show:

mParticle.Consent Class

Invoke these methods on the mParticle.Consent object. Example: mParticle.Consent.createConsentState()

Methods

createCCPAConsent

(
  • optOut
  • timestamp
  • consentDocument
  • location
  • hardwareId
)
Object

Creates a CCPA Opt Out Consent State.

Parameters:

  • optOut Boolean

    true represents a "data sale opt-out", false represents the user declining a "data sale opt-out"

  • timestamp Number

    Unix time (likely to be Date.now())

  • consentDocument String

    document version or experience that the user may have consented to

  • location String

    location where the user gave consent

  • hardwareId String

    hardware ID for the device or browser used to give consent. This property exists only to provide additional context and is not used to identify users

Returns:

Object:

CCPA Consent State

createConsentState

() Object

Creates a Consent State Object, which can then be used to set CCPA states, add multiple GDPR states, as well as get and remove these privacy states.

Returns:

Object:

ConsentState object

createGDPRConsent

(
  • consent
  • timestamp
  • consentDocument
  • location
  • hardwareId
)
Object

Creates a GDPR Consent State.

Parameters:

  • consent Boolean

    true represents a "data sale opt-out", false represents the user declining a "data sale opt-out"

  • timestamp Number

    Unix time (likely to be Date.now())

  • consentDocument String

    document version or experience that the user may have consented to

  • location String

    location where the user gave consent

  • hardwareId String

    hardware ID for the device or browser used to give consent. This property exists only to provide additional context and is not used to identify users

Returns:

Object:

GDPR Consent State