ecommerce traits

data events that describe what a user is doing on your site

Traits are structured data events that describe what a user is doing on your ecommerce site: viewing a product, filtering a list, clicking on a promotion, etc.

Sending these traits allows Powerpop to:

  • Understand user context and behavior.

  • Trigger popups and personalized messages based.

  • Improve segmentation and campaign performance.

How to send a Trait

To send a trait, simply call the sendTraits function with the appropriate trait name and optional trait properties based on our documentation. You can customize or extend these properties as needed to fit your specific business logic.

sendTraits('traitName', traitOptions)
example:

sendTraits('productViewed', {
      product_id: '507f1f77bcf86cd799439011',
      sku: '45790-32',      
      category: 'Games',
      name: 'Monopoly: 3rd Edition', 
      brand:"Monopoly",
      variant:"blue",
      price: 190,
      quantity:1,
      coupon:"buy2get3",
      currency:"USD",
      position: 1,
      url: 'https://www.example.com/product/path',
      image_url: 'https://www.example.com/product/path.jpg'
    })

Product specification

The following are reserved product parameters. All of them are optional, and you can extend this structure with any custom parameters needed for your business logic.

sku Unique identifier for the product (internal or database ID).
product_id Stock Keeping Unit – unique code used to track inventory.
category Product category or classification (e.g., “Games”, “Shoes”).
name Display name of the product.
brand Brand or manufacturer of the product.
variant Specific variant of the product (e.g., color, size).
price Unit price of the product (excluding discounts).
quantity Number of units involved in the action (e.g., added to cart, purchased).
coupon Coupon or discount code applied to the product, if any.
currency Currency code in ISO format (e.g., “USD”, “EUR”).
position Position of the product in a list or recommendation (e.g., first = 1).
url Full URL to the product’s detail page on your website.
image_url URL of the product image used for display purposes.
Example - a visitor add product to shopping basket:  

sendTraits('productAdded', {
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand:"Monopoly",
variant:"blue",
price: 190,
quantity:1,
coupon:"buy2get3",
currency:"USD",
position: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
})
 

Predefined traits

Trait name Description type description
productListViewed list_id string Product list being viewed
category string Product category being viewed
products array<products> Products displayed in the product list
searchUsed query string the query user search with
productListFiltered list_id string Product list being viewed
category string Product category being viewed
filters array<filters> Product filters that the customer is using
filters.$.type string Id of the filter type that the customer is using (department,…)
filters.$.value string Id of the selection that the customer chose (beauty,..)
sorts array<Sort> Product sorting that the customer is using
sorts.$.type string Id of the sort type that the customer is using (price,..)
sorts.$.value string Id of the selection type the the customer is using (ascending, descending)
products array<products> Products displayed in the product list
promotionViewed promotion_id string Promotion’s ID
creative string Promotion’s creative
name string Promotion’s name
position string Promotion’s position
productViewed product product product viewed
productAdded product product product added to shopping basket
productRemoved product product product removed from shopping basket
cartViewed cart_id string Shopping cart ID
products array<products> Products displayed in the product list
checkoutStarted order_id String Order/transaction ID
affiliation String Store or affiliation from which this transaction occurred (for example, Google Store)
value Number Revenue ($) with discounts and coupons added in.
revenue Number Revenue ($) associated with the transaction (excluding shipping and tax)
shipping Number Shipping cost associated with the transaction
tax Number Total tax associated with the transaction
discount Number Total discount associated with the transaction
coupon String Transaction coupon redeemed with the transaction
currency String Currency code associated with the transaction
products Array Products in the order
checkOutStep
 
 
 
checkout_id String Checkout transaction ID
step Number Number representing a step in the checkout process
shipping_method String String representing the shipping the method chosen
payment_method String String representing the payment method chosen
orderCompleted
 
 
 
 
 
 
 
 
 
 
 
checkout_id String Checkout ID
order_id String Order/transaction ID
affiliation String Store or affiliation from which this transaction occurred (for example, Google Store)
subtotal Number Order total after discounts but before taxes and shipping
total Number Subtotal with shipping and taxes added in.
revenue Number Revenue associated with the transaction (including discounts, but excluding shipping and taxes)
shipping Number Shipping cost associated with the transaction
tax Number Total tax associated with the transaction
discount Number Total discount associated with the transaction
coupon String Transaction coupon redeemed with the transaction
currency String Currency code associated with the transaction
products Array Products in the order
orderCancelled order_id String Order/transaction ID
affiliation String Store or affiliation from which this transaction occurred (for example, Google Store)
total Number Revenue ($) with discounts and coupons added in.
revenue Number Revenue ($) associated with the transaction (excluding shipping and tax)
shipping Number Shipping cost associated with the transaction
tax Number Total tax associated with the transaction
discount Number Total discount associated with the transaction
coupon String Transaction coupon redeemed with the transaction
currency String Currency code associated with the transaction
products Array Products in the order
couponEntered order_id String Order/transaction ID, if applicable
cart_id String Cart ID, if applicable
coupon_id String Coupon ID
couponApplied order_id String Order/transaction ID, if applicable
cart_id String Cart ID, if applicable
coupon_id String Coupon ID
coupon_name String Coupon name
discount Number Monetary discount applied through the coupon
couponDenied order_id String Order/transaction ID, if applicable
cart_id String Cart ID, if applicable
coupon_id String Coupon ID
coupon_name String Coupon name
reason String Reason the coupon was denied
addedToWishList wishlist_id String Wishlist ID to which the product was added to
wishlist_name String Wishlist name to which the product was added to
product_id String Database id of the product being viewed
sku String Sku of the product being viewed
category String Product category being viewed
name String Name of the product being viewed
brand String Brand associated with the product
variant String Variant of the product
price Number Price ($) of the product being viewed
quantity Number Quantity of a product
coupon String Coupon code associated with a product (for example, MAY_DEALS_3)
position Number Position in the product list (ex. 3)
url String URL of the product page
image_url String Image url of the product
removedFromWishList wishlist_id String Wishlist ID to which the product was added to
wishlist_name String Wishlist name to which the product was added to
product_id String Database id of the product being viewed
sku String Sku of the product being viewed
category String Product category being viewed
name String Name of the product being viewed
brand String Brand associated with the product
variant String Variant of the product
price Number Price ($) of the product being viewed
quantity Number Quantity of a product
coupon String Coupon code associated with a product (for example, MAY_DEALS_3)
position Number Position in the product list (ex. 3)
url String URL of the product page
image_url String Image url of the product
productShared share_via String Method of sharing
share_message String Message that the sender sent
recipient String Recipient of the sharing
product_id String Database ID of the product being viewed
sku String Sku of the product being viewed
category String Product category being viewed
name String Name of the product being viewed
brand String Brand associated with the product
variant String Variant of the product
price Number Price ($) of the product being viewed
url String URL of the product page
image_url String Image url of the product
cartShared share_via String Method of sharing
share_message String Message that the sender sent
recipient String Recipient of the sharing
cart_id String Shopping cart ID
products Array Products displayed in the product list
products.$.product_id String Product id displayed on the list
productReviewed product_id String Product’s ID
review_id String Review ID
review_body String Review body
rating String Review rating

Ready To Get Started?