API Docs for: 2.8.5
Show:

mParticle.eCommerce Class

Defined in: src/main.js:470

Invoke these methods on the mParticle.eCommerce object. Example: mParticle.eCommerce.createImpresion(...)

Methods

createImpression

(
  • name
  • product
)

Defined in src/main.js:554

Creates a product impression

Parameters:

  • name String

    impression name

  • product Object

    the product for which an impression is being created

createProduct

(
  • name
  • sku
  • price
  • [quantity]
  • [variant]
  • [category]
  • [brand]
  • [position]
  • [coupon]
  • [attributes]
)

Defined in src/main.js:522

Creates a product

Parameters:

  • name String

    product name

  • sku String

    product sku

  • price Number

    product price

  • [quantity] Number optional

    product quantity. If blank, defaults to 1.

  • [variant] String optional

    product variant

  • [category] String optional

    product category

  • [brand] String optional

    product brand

  • [position] Number optional

    product position

  • [coupon] String optional

    product coupon

  • [attributes] Object optional

    product attributes

createPromotion

(
  • id
  • [creative]
  • [name]
  • [position]
)

Defined in src/main.js:541

Creates a promotion

Parameters:

  • id String

    a unique promotion id

  • [creative] String optional

    promotion creative

  • [name] String optional

    promotion name

  • [position] Number optional

    promotion position

createTransactionAttributes

(
  • id
  • [affiliation]
  • [couponCode]
  • [revenue]
  • [shipping]
  • [tax]
)

Defined in src/main.js:565

Creates a transaction attributes object to be used with a checkout

Parameters:

  • id String or Number

    a unique transaction id

  • [affiliation] String optional

    affilliation

  • [couponCode] String optional

    the coupon code for which you are creating transaction attributes

  • [revenue] Number optional

    total revenue for the product being purchased

  • [shipping] String optional

    the shipping method

  • [tax] Number optional

    the tax amount

logCheckout

(
  • step
  • options
  • attrs
  • [customFlags]
)

Defined in src/main.js:580

Logs a checkout action

Parameters:

  • step Number

    checkout step number

  • options Object
  • attrs Object
  • [customFlags] Object optional

    Custom flags for the event

logImpression

(
  • impression
  • attrs
  • [customFlags]
)

Defined in src/main.js:641

Logs a product impression

Parameters:

  • impression Object

    product impression object

  • attrs Object

    attributes related to the impression log

  • [customFlags] Object optional

    Custom flags for the event

logProductAction

(
  • productActionType
  • product
  • [attrs]
  • [customFlags]
)

Defined in src/main.js:593

Logs a product action

Parameters:

  • productActionType Number

    product action type as found here

  • product Object

    the product for which you are creating the product action

  • [attrs] Object optional

    attributes related to the product action

  • [customFlags] Object optional

    Custom flags for the event

logPromotion

(
  • type
  • promotion
  • [attrs]
  • [customFlags]
)

Defined in src/main.js:628

Logs a product promotion

Parameters:

  • type Number

    the promotion type as found here

  • promotion Object

    promotion object

  • [attrs] Object optional

    boolean to clear the cart after logging or not

  • [customFlags] Object optional

    Custom flags for the event

logPurchase

(
  • transactionAttributes
  • product
  • [clearCart]
  • [attrs]
  • [customFlags]
)

Defined in src/main.js:606

Logs a product purchase

Parameters:

  • transactionAttributes Object

    transactionAttributes object

  • product Object

    the product being purchased

  • [clearCart] Boolean optional

    boolean to clear the cart after logging or not. Defaults to false

  • [attrs] Object optional

    other attributes related to the product purchase

  • [customFlags] Object optional

    Custom flags for the event

logRefund

(
  • transactionAttributes
  • product
  • [clearCart]
  • [attrs]
  • [customFlags]
)

Defined in src/main.js:653

Logs a refund

Parameters:

  • transactionAttributes Object

    transaction attributes related to the refund

  • product Object

    product being refunded

  • [clearCart] Boolean optional

    boolean to clear the cart after refund is logged. Defaults to false.

  • [attrs] Object optional

    attributes related to the refund

  • [customFlags] Object optional

    Custom flags for the event

setCurrencyCode

(
  • code
)

Defined in src/main.js:508

Sets the currency code

Parameters:

  • code String

    The currency code