Product Events
Overview
Product events represent the customer's journey as they choose and decide the product to order.
trackProductClicked (Product)
An event triggered when a customer clicks on a product link to view more details.
Parameters
Parameter | Data type | Description |
---|---|---|
product required | object | The product that the customer clicks on. |
Example
affirm.analytics.trackProductClicked({
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm T-Shirt",
"price": 730,
"productId": "SKU-1234",
"quantity": 1,
"variant": "Black"
});
trackProductViewed (Product)
Parameters
Parameter | Data type | Description |
---|---|---|
product required | object | The product the customer viewed. |
Example
affirm.analytics.trackProductViewed({
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm T-Shirt",
"price": 730,
"productId": "SKU-1234",
"quantity": 1,
"variant": "Black"
});
An event triggered when a customer adds a product to their cart.
Parameters
Parameter | Data type | Description |
---|---|---|
product required | object | The product that the customer adds to their cart. |
cart optional | object | The cart the customer adds the product to. An undefined argument implies that customers may only have one cart at all times. |
Example
affirm.analytics.trackProductAdded({
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm T-Shirt",
"price": 730,
"productId": "SKU-1234",
"quantity": 1,
"variant": "Black"
}, {
"cartId": "CART-1234",
"name": "Main Cart"
});
An event triggered when a customer removes a product from their cart.
Parameters
Parameter | Data type | Description |
---|---|---|
product required | object | The product that the customer removes from their cart. |
cart optional | object | The cart the customer removes the product from. An undefined argument implies that customers may only have one cart at all times. |
Example
affirm.analytics.trackProductRemoved({
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm T-Shirt",
"price": 730,
"productId": "SKU-1234",
"quantity": 1,
"variant": "Black"
}, {
"cartId": "CART-1234",
"name": "Main Cart"
});
An event triggered when a customer views their cart.
Parameters
Parameter | Data type | Description |
---|---|---|
product required | array | The products in the cart when the customer viewed it. |
cart optional | object | The cart the customer viewed. An undefined argument implies that customers may only have one cart at all times. |
Example
affirm.analytics.trackCartViewed([{
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm T-Shirt",
"price": 730,
"productId": "SKU-1234",
"quantity": 1,
"variant": "Black"
}, {
"brand": "Affirm",
"category": "Apparel",
"coupon": "SUMMER2018",
"name": "Affirm Turtleneck Sweater",
"price": 2190,
"productId": "SKU-5678",
"quantity": 1,
"variant": "Black"
}], {
"cartId": "CART-1234",
"name": "Main Cart"
});
Objects
Product
Represents any offered product or service.
Parameter | Description | |
---|---|---|
brand optional | string Maximum length: 500 Protocol parameter: prbr | The brand of the product (e.g., Affirm). |
category optional | string Maximum length: 500 Protocol parameter: prca | The category the product belongs to (e.g., Apparel). |
coupon optional | string Maximum length: 500 Protocol parameter: prcc | Any coupon code associated with the particular instance of this product. |
name optional | string Maximum length: 500 Protocol parameter: osn | The full name of the product (e.g., Affirm T-Shirt). |
price optional | integer Protocol parameter: prpr | The price of the product. The value must be non-negative and represented as cents instead of dollars. |
productID optional | string Maximum length: 500 Protocol parameter: prid | A unique identifier representing the product, such as the SKU or an internal database identifier used by the merchant. |
quantity optional | integer Protocol parameter: prqt | The quantity of the product. The value must be non-negative. |
variant optional | string Maximum length: 500 Protocol parameter: prva | The variant of the product (e.g., black). |
currency optional | string Protocol parameter: prcu | A currency code associated with this product (USD). |
Cart
Represents a user’s cart. This is an optional argument for most of the functions in the Enhanced Analytics API. It is intended to support analytics for eCommerce websites that allow customers to have multiple carts.
Parameter | Data type | Description |
---|---|---|
cartID required | string Maximum length: 500 Protocol parameter: ctid | A unique identifier representing the user’s cart. |
name optional | string Maximum length: 500 Protocol parameter: ctnm | The name of the cart. |
Updated 2 months ago