+49 69 83008980 service@xqueue.com

Benötigen Sie Hilfe?

Shopping Cart Abandonment

Sie sind hier:
< Alle Themen

 

This page provides a sketch for creating abandoned cart mails. Not all attributes need to be filled, as not each shop system can provide all data or some data is decided not to be required for the usecase. However, having a common transaction type can ease development.

Attribute Mandatory Type Description
cart.id yes String ID of the cart
cart.date yes Timestamp Time information when the cart was updated last
cart.items yes JSON Set items in the cart. See table below for data definition.
cart.product_ids String Comma separated list of product IDs in the cart for easier filtering
cart.categories String Comma separated list of categories in the cart for easier filtering
cart.brands String Comma separated list of brands in the cart for easier filtering
cart.total yes Double Overall price
cart.total_no_shipping * Double Overall price without shipping fees
cart.total_tax yes Double Taxes applied
cart.total_fees yes Double Sum of fees, like shipping costs
cart.total_refunds Double Sum of refunds
cart.fees JSON Set of fees applied to the cart, e.g. shipping fee. See table below for data definition.
cart.refunds JSON Set of refunds applied to the cart, e.g. some cashback. See table below for data definition.
cart.currency yes String Currency, e.g. €
discount.code String If there is a simple discount code, e.g. a voucher code
discount.total String The sum of discounts
discount.rules JSON Set of rules applied to the cart, e.g. vouchers. See table below for data definition.
discount.rules_string String Rules as a CSV string. Can be used for filters
customer.salutation * String Salutation
customer.fullname String Full name
customer.firstname String First name
customer.lastname String Last name
customer.id * String Customer ID
generic.string_1 String
generic.string_2 String
generic.string_3 String
generic.string_4 String
generic.string_5 String
generic.string_6 String
generic.string_7 String
generic.string_8 String
generic.string_9 String
generic.string_10 String
generic.double_1 Double
generic.double_2 Double
generic.double_3 Double
generic.double_4 Double
generic.double_5 Double
generic.integer_1 Integer
generic.integer_2 Integer
generic.integer_3 Integer
generic.integer_4 Integer
generic.integer_5 Integer
generic.boolean_1 Boolean
generic.boolean_2 Boolean
generic.boolean_3 Boolean
generic.boolean_4 Boolean
generic.boolean_5 Boolean
generic.date_1 Date
generic.date_2 Date
generic.date_3 Date
generic.timestamp_1 Timestamp
generic.timestamp_2 Timestamp
generic.timestamp_3 Timestamp
generic.json_1 JSON
generic.json_2 JSON
generic.json_3 JSON

 

Attributes: cart.items
Attribute Mandatory Type Description
sku yes String Stock Keeping Unit
product id String Often there is a product ID that differs from SKU
is_gift Boolean Indicates if it is a gift
title yes String Title of the product
description * String Regular description
short_description String Short (teaser) description
review String A review comment
release_date Date Date of product release
url yes String URL to the product in the shop
image_url yes String URL of the image to display
status * String Idicates, if the product available, delayed, shipped, sold out, etc.
quantity yes Integer Quantity
single_price yes Double Price of a single product
total yes Double Total cost
categories * String Categories as a CSV string
seller.id String ID of a third party seller, e.g. for marketplaces
seller.name String Name of the seller
seller.url String URL to the details of a seller
attributes JSON If there are attributes required that are missing or should be displayed, e.g. as a list
brand String Brand
color String Color
weight String Weight
width String Width
height String Height
estimated_delivery_time String E.g. “3 Working Days”

 

Attributes: cart.discount.rules
Attribute Mandatory Type Description
id String Internal ID of the rule
name yes String Readable name of the rule
description String Description
total yes Double Number to display
type * String Defines, if the discount is absolute or in percent

 

Attributes: cart.fees
Attribute Mandatory Type Description
id String Internal ID of the fee
name yes String Readable name of the fee
description String Description
total yes Double Number to display

 

Attributes: cart.refunds
Attribute Mandatory Type Description
id String Internal ID of the refund
name yes String Readable name of the refund
description String Description
total yes Double Number to display

 

Sourcecode for Cart Abandonments (PHP)
public function getOrderTransactionType() {
    $attributes = array();
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.id", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.date", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.status", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.estimated_delivery_time", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.estimated_delivery_date", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.items", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.product_ids", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.categories", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.brands", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.total", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.total_no_shipping", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.total_tax", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.total_fees", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.total_refunds", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.fees", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.refunds", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "cart.currency", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.code", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.total", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.rules", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.rules_string", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.salutation", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.fullname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.firstname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.lastname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.id", com_maileon_api_transactions_DataType::$STRING, false));
    $attributes = $this->addGenericFields($attributes);
    
    $orderTxTypeRetentionTime = 365;
    return new com_maileon_api_transactions_TransactionType(null, self::TX_TYPE_NAME_ORDER, $attributes, $orderTxTypeRetentionTime, false, "An order triggered by X");
}
private function addGenericFields($attributes) {
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_1", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_2", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_3", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_4", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_5", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_6", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_7", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_8", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_9", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_10", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_1", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_2", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_3", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_4", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_5", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_1", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_2", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_3", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_4", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_5", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_1", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_2", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_3", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_4", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_5", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_1", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_2", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_3", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_1", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_2", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_3", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_1", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_2", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_3", com_maileon_api_transactions_DataType::$JSON, false));
    return $attributes;
}

 

Inhaltsverzeichnis