Sales Insights (ECommerce)
Sales Insight has multiple premade analysis that are based on native events but also on the properties that are currently tracked. It allows you to send events at different steps of the purchase funnel to give you a detailed view from start to finish.
You'll first have the products impressions, the creation and evolution of the cart and its content to finally have a transaction.
note
These are examples, the property list can be changed to fit your needs. You can very well remove properties and add custom properties on top. Please note that the implementation in those examples represent best practices whenever you want to fill the premade analyses available in the Piano Analytics interfaces.
PRODUCT EVENTS
Product.display
Mandatory property: product_id
Impression of a product on a given page. Aside from the product_id
that is mandatory, this implementation is recommended at least to allow you to fill all of the premade analysis in the interface.
pa.sendEvent("product.display", {
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
});
Product.page_display
Mandatory property: product_id
Impression of a product page. Aside from the product_id
that is mandatory, this implementation is recommended at least to allow you to fill all of the premade analysis in the interface.
pa.sendEvent("product.page_display", {
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
});
Product.add_to_cart
Mandatory properties: product_id
Add a product to a cart. Aside from the product_id
that is mandatory, this implementation is recommended at least to allow you to fill all of the premade analysis in the interface.
Adding the cart.creation event is only needed whenever the 'product.add_to_cart' creates a new cart.
pa.sendEvents([
{
name: "product.add_to_cart",
data: {
cart_id: "LAPW221C",
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
product_quantity: 1,
product_cartcreation: true,
},
},
{
name: "cart.creation", // Only if product_cartcreation: true
data: {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
},
},
]);
Product.remove_from_cart
Mandatory properties: product_id
Remove a product from a cart. Aside from the product_id
that is mandatory, this implementation is recommended at least to allow you to fill all of the premade analysis in the interface.
pa.sendEvent("product.remove_from_cart", {
cart_id: "LAPW221C",
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
product_quantity: 1,
});
CART EVENTS
Cart.creation
Mandatory property: cart_id
This event can be used alongside others or as a standalone event whenever a new cart is created.
pa.sendEvent("cart.creation", {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
});
Cart.display
Mandatory property: cart_id
This event can be sent everytime the cart page is loaded.
pa.sendEvent("cart.display", {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
});
Cart.update
Mandatory property: cart_id
This event can be sent everytime the cart gets updated. It is meant to send the latest known state of the cart's value.
pa.sendEvent("cart.update", {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
});
Cart.delivery
Mandatory property: cart_id
This event can be used to measure the delivery method selection step. The shipping properties in the example are not mandatory but can be sent on this step if known at this moment. Otherwise it can be done in the cart.payment step
pa.sendEvent("cart.delivery", {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
shipping_delivery: "Express",
shipping_costtaxincluded: 11.99,
shipping_costtaxfree: 10.99,
});
Cart.payment
Mandatory property: cart_id
This event can be used to measure the payment step. The payment method can be sent at this moment if known.
pa.sendEvent("cart.payment", {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
shipping_delivery: "Express",
shipping_costtaxincluded: 11.99,
shipping_costtaxfree: 10.99,
payment_mode: "Credit card",
});
Cart.awaiting_payment and Product.awaiting_payment
Mandatory property: cart_id
and product_id
and cart_version
These events can be used whenever the sales need to be validated server-side. If the validation is not server-side, it will be excluded. The products are not mandatory but will allow you to see the different articles in the cart.
pa.sendEvents([
{
name: "cart.awaiting_payment",
data: {
cart_id: "LAPW221C", // mandatory property
cart_version: "VER211SQ", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
shipping_delivery: "Express",
shipping_costtaxincluded: 11.99,
shipping_costtaxfree: 10.99,
},
},
{
name: "product.awaiting_payment",
data: {
cart_id: "LAPW221C", // mandatory property
cart_version: "VER211SQ", // mandatory property
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
product_quantity: 1,
},
},
]);
SERVER-SIDE EVENTS
Server-side transaction confirmation
Mandatory property: cart_id
and transaction_id
and offsite_confirmation:true
This server-side request allows you to validate a cart that was previously awaiting payment.
https://logsX.xiti.com/hit.xiti?s=XXXXX&events=[{"name":"transaction.confirmation","data":{"cart_id":"XXXXX",
"transaction_id":"XXXXX", "offsite_confirmation":true}}]&rdt=off
TRANSACTION EVENTS
Transaction.confirmation and product.purchased
Mandatory property: cart_id
and product_id
and transaction_id
These events are sent whenever a transaction is made. On this example, the cart and the products are validated.
pa.sendEvents([
{
name: "transaction.confirmation",
data: {
cart_id: "LAPW221C", // mandatory property
cart_currency: "EUR",
cart_turnovertaxincluded: 1399.9,
cart_turnovertaxfree: 1120.9,
cart_quantity: 1,
cart_nbdistinctproduct: 1,
shipping_delivery: "Express",
shipping_costtaxincluded: 11.99,
shipping_costtaxfree: 10.99,
transaction_id: "TR221SI", // mandatory property
transaction_promocode: ["REDUC10"],
transaction_firstpurchase: true,
payment_mode: "Credit card",
},
},
{
name: "product.purchased",
data: {
cart_id: "LAPW221C", // mandatory property
product_id: "LPTAX174", // mandatory property
product: "Laptop AX174",
product_variant: "8Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1399.9,
product_pricetaxfree: 1120.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
product_quantity: 1,
payment_mode: "Credit card",
transaction_id: "TR221SI", // mandatory property
transaction_promocode: ["REDUC10"],
},
},
{
name: "product.purchased",
data: {
cart_id: "LAPW221C", // mandatory property
product_id: "LPTAX176", // mandatory property
product: "Laptop AX176",
product_variant: "16Go RAM",
product_brand: "Laptop",
product_discount: false,
product_pricetaxincluded: 1599.9,
product_pricetaxfree: 1220.9,
product_currency: "EUR",
product_stock: true,
product_category1: "Hardware",
product_category2: "Computer",
product_category3: "Gaming",
product_category4: "Laptop",
product_quantity: 1,
payment_mode: "Credit card",
transaction_id: "TR221SI", // mandatory property
transaction_promocode: ["REDUC10"],
},
},
]);
ANNEXES
Product properties
Property | Description | Type | Mandatory | Example |
---|---|---|---|---|
product_id | ID | string | Yes | 'LPTAX174' |
product | Label | string | 'Laptop AX174' | |
product_variant | Variant | string | '8Go RAM' | |
product_brand | Brand | string | 'Loptap' | |
product_discount | Discounted product? | boolean | false | |
product_pricetaxincluded | Price tax included | float | 1399.90 | |
product_pricetaxfree | Price tax free | float | 1120.90 | |
product_currency | Currency (ISO 4217) | string | 'EUR' | |
product_stock | Product in stock? | boolean | true | |
product_quantity | Quantity | int | 1 | |
product_category1 | Level 1 category | string | 'Hardware' | |
product_category2 | Level 2 category | string | 'Computer' | |
product_category3 | Level 3 category | string | 'Gaming' | |
product_category4 | Level 4 category | string | 'Laptop' | |
product_cartcreation | Cart created by this product addition? | boolean | false |
Cart properties
Property | Description | Type | Mandatory | Example |
---|---|---|---|---|
cart_id | ID | string | Yes | 'HW-8892' |
cart_currency | Currency (ISO 4217) | string | 'EUR' | |
cart_turnovertaxincluded | Turnover tax included | float | 2900.00 | |
cart_turnovertaxfree | Turnover tax free | float | 2340.50 | |
cart_creation_utc | Cart creation date (timestamp UTC in seconds) | int | 1501065673 | |
cart_quantity | Number of products | int | 3 | |
cart_nbdistinctproduct | Number of distinct products | int | 2 | |
cart_version | When updating the cart awaiting payment (adding/removing a product), it will be necessary to generate a new unique version identifier (cart_version) associated with the cart (cart_id). This is necessary when using pending carts/products (cart.awaiting_payment / product.awaiting_payment) | string | 'v1' |
Transaction properties
Property | Description | Type | Mandatory | Example |
---|---|---|---|---|
transaction_id | ID | string | Yes | '29984' |
transaction_promocode | Promo code list | array of string | ['BLACKFRIDAY', 'VIP'] | |
transaction_firstpurchase | First purchase of the customer? | boolean | true |
Shipping properties
Property | Description | Type | Mandatory | Example |
---|---|---|---|---|
shipping_delivery | Shipping type | string | 'Express' | |
shipping_costtaxincluded | Shipping cost tax included | float | 10.50 | |
shipping_costtaxfree | Shipping cost tax free | float | 8.00 |
Payment properties
Property | Description | Type | Mandatory | Example |
---|---|---|---|---|
payment_mode | Payment mode | string | 'Credit card' |