ecommerceOrder
The ecommerceOrder() method tracks conversions, including products and payment details.
Syntax
ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
eCommerce.ecommerceOrder(products, paymentInformation[, options])
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
products | Array<Product> | List of products | Yes |
paymentInformation | object | The total value of items in a cart has to be a float number or a string containing float number representation. | Yes |
options | object | Optional object used to provide additional parameters to the request | No |
Product Object
Attribute | Type | Description | Required |
---|---|---|---|
sku | string | Product stock-keeping unit. | Yes |
name | string | Product name (default: “”). | No |
category | string | Array<string> | Product category or an array of up to 5 categories. Default: “”. | No |
price | number | string | Product price must be a float number or a string containing float number representation. Default: 0. | No |
quantity | number | string | Product quantity must be an integer number or a string containing integer representation. Default: 1. | No |
brand | string | Product brand. Default: “”. | No |
variant | string | Product variant. Default: “”. | No |
customDimensions | object | Product custom dimensions. Default: {}. | No |
Payment Information Object
Attribute | Type | Description | Required |
---|---|---|---|
orderId | string | Unique order identifier. | Yes |
grandTotal | number | string | The total value of items in the cart. Must be a float number or a string containing a float number representation. | Yes |
subTotal | number | string | The total value of items in the cart without shipping. Must be a float number or a string containing a float number representation. | No |
tax | number | string | The total tax amount. Must be a float number or a string containing a float number representation. | No |
shipping | number | string | The total shipping cost. Must be a float number or a string containing a float number representation. | No |
discount | number | string | The total discount. Must be a float number or a string containing a float number representation. | No |
Options Object
Option | Type | Description | Required |
---|---|---|---|
currencyCode | string | Currency of the 'conversionValue' in ISO 4217 format. If not provided, the currency set in app settings will be used instead. | No |
Examples
_paq.push([
"ecommerceOrder",
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" },
]);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
eCommerce.ecommerceOrder(
[
{
sku: "craft-311",
name: "Unicorn Iron on Patch",
category: "Crafts & Sewing",
price: "150.00",
quantity: 3,
brand: "DMZ",
variant: "blue",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
{
sku: "craft-312",
name: "Unicorn Iron on Grass",
category: "Crafts & Sewing",
price: "30.00",
quantity: 1,
brand: "DMZ",
variant: "red",
customDimensions: {
1: "coupon-2020",
2: "20%",
},
},
],
{
orderId: "order-3415",
grandTotal: "180.00",
subTotal: "120.00",
tax: "39.60",
shipping: "60.00",
discount: "18.00",
},
{ currencyCode: "EUR" }
);
Related methods
Updated 8 days ago
Did this page help you?