mParticle.eCommerce Class
Invoke these methods on the mParticle.eCommerce object. Example: mParticle.eCommerce.createImpresion(...)
Item Index
Methods
createImpression
        - 
                        
name - 
                        
product 
Creates a product impression
Parameters:
- 
                        
nameStringimpression name
 - 
                        
productObjectthe product for which an impression is being created
 
createProduct
        - 
                        
name - 
                        
sku - 
                        
price - 
                        
[quantity] - 
                        
[variant] - 
                        
[category] - 
                        
[brand] - 
                        
[position] - 
                        
[coupon] - 
                        
[attributes] 
Creates a product
Parameters:
- 
                        
nameStringproduct name
 - 
                        
skuStringproduct sku
 - 
                        
priceNumberproduct price
 - 
                        
[quantity]Number optionalproduct quantity. If blank, defaults to 1.
 - 
                        
[variant]String optionalproduct variant
 - 
                        
[category]String optionalproduct category
 - 
                        
[brand]String optionalproduct brand
 - 
                        
[position]Number optionalproduct position
 - 
                        
[coupon]String optionalproduct coupon
 - 
                        
[attributes]Object optionalproduct attributes
 
createPromotion
        - 
                        
id - 
                        
[creative] - 
                        
[name] - 
                        
[position] 
Creates a promotion
Parameters:
- 
                        
idStringa unique promotion id
 - 
                        
[creative]String optionalpromotion creative
 - 
                        
[name]String optionalpromotion name
 - 
                        
[position]Number optionalpromotion position
 
createTransactionAttributes
        - 
                        
id - 
                        
[affiliation] - 
                        
[couponCode] - 
                        
[revenue] - 
                        
[shipping] - 
                        
[tax] 
Creates a transaction attributes object to be used with a checkout
Parameters:
- 
                        
idString or Numbera unique transaction id
 - 
                        
[affiliation]String optionalaffilliation
 - 
                        
[couponCode]String optionalthe coupon code for which you are creating transaction attributes
 - 
                        
[revenue]Number optionaltotal revenue for the product being purchased
 - 
                        
[shipping]String optionalthe shipping method
 - 
                        
[tax]Number optionalthe tax amount
 
getIntegrationAttributes
        - 
                        
integrationId 
Get integration attributes for a given integration ID.
Parameters:
- 
                        
integrationIdNumbermParticle integration ID
 
Returns:
an object map of the integrationId's attributes
logCheckout
        - 
                        
step - 
                        
option - 
                        
attrs - 
                        
[customFlags] 
Logs a checkout action
Parameters:
- 
                        
stepNumbercheckout step number
 - 
                        
optionString - 
                        
attrsObject - 
                        
[customFlags]Object optionalCustom flags for the event
 
logImpression
        - 
                        
impression - 
                        
attrs - 
                        
[customFlags] - 
                        
[eventOptions] 
Logs a product impression
Parameters:
- 
                        
impressionObjectproduct impression object
 - 
                        
attrsObjectattributes related to the impression log
 - 
                        
[customFlags]Object optionalCustom flags for the event
 - 
                        
[eventOptions]Object optionalFor Event-level Configuration Options
 
logProductAction
        - 
                        
productActionType - 
                        
product - 
                        
[attrs] - 
                        
[customFlags] - 
                        
[transactionAttributes] - 
                        
[eventOptions] 
Logs a product action
Parameters:
- 
                        
productActionTypeNumberproduct action type as found here
 - 
                        
productObjectthe product for which you are creating the product action
 - 
                        
[attrs]Object optionalattributes related to the product action
 - 
                        
[customFlags]Object optionalCustom flags for the event
 - 
                        
[transactionAttributes]Object optionalTransaction Attributes for the event
 - 
                        
[eventOptions]Object optionalFor Event-level Configuration Options
 
logPromotion
        - 
                        
type - 
                        
promotion - 
                        
[attrs] - 
                        
[customFlags] - 
                        
[eventOptions] 
Logs a product promotion
Parameters:
- 
                        
typeNumberthe promotion type as found here
 - 
                        
promotionObjectpromotion object
 - 
                        
[attrs]Object optionalboolean to clear the cart after logging or not
 - 
                        
[customFlags]Object optionalCustom flags for the event
 - 
                        
[eventOptions]Object optionalFor Event-level Configuration Options
 
logPurchase
        - 
                        
transactionAttributes - 
                        
product - 
                        
[clearCart] - 
                        
[attrs] - 
                        
[customFlags] 
Logs a product purchase
Parameters:
- 
                        
transactionAttributesObjecttransactionAttributes object
 - 
                        
productObjectthe product being purchased
 - 
                        
[clearCart]Boolean optionalboolean to clear the cart after logging or not. Defaults to false
 - 
                        
[attrs]Object optionalother attributes related to the product purchase
 - 
                        
[customFlags]Object optionalCustom flags for the event
 
logRefund
        - 
                        
transactionAttributes - 
                        
product - 
                        
[clearCart] - 
                        
[attrs] - 
                        
[customFlags] 
Logs a refund
Parameters:
- 
                        
transactionAttributesObjecttransaction attributes related to the refund
 - 
                        
productObjectproduct being refunded
 - 
                        
[clearCart]Boolean optionalboolean to clear the cart after refund is logged. Defaults to false.
 - 
                        
[attrs]Object optionalattributes related to the refund
 - 
                        
[customFlags]Object optionalCustom flags for the event
 
setCurrencyCode
        - 
                        
code 
Sets the currency code
Parameters:
- 
                        
codeStringThe currency code
 
setIntegrationAttribute
        - 
                        
integrationId - 
                        
attrs 
Set or remove the integration attributes for a given integration ID. Integration attributes are keys and values specific to a given integration. For example, many integrations have their own internal user/device ID. mParticle will store integration attributes for a given device, and will be able to use these values for server-to-server communication to services. This is often useful when used in combination with a server-to-server feed, allowing the feed to be enriched with the necessary integration attributes to be properly forwarded to the given integration.
Parameters:
- 
                        
integrationIdNumbermParticle integration ID
 - 
                        
attrsObjecta map of attributes that will replace any current attributes. The keys are predefined by mParticle. Please consult with the mParticle docs or your solutions consultant for the correct value. You may also pass a null or empty map here to remove all of the attributes.
 
setOptOut
        - 
                        
isOptingOut 
Set opt out of logging
Parameters:
- 
                        
isOptingOutBooleanboolean to opt out or not. When set to true, opt out of logging.
 
setSessionAttribute
        - 
                        
key - 
                        
value 
Sets a session attribute
Parameters:
- 
                        
keyStringkey for session attribute
 - 
                        
valueString or Numbervalue for session attribute
 
