Ecommerce events

This is for:

Developer

ecBasket

Emitted on an order summary page to summarize the items added to a user’s basket.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The shipping cost added to the basket

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the value of the basket after the application of taxes, but before any discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

Example JavaScript

uv.emit('ecBasket',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 9.99,
      currency: 'USD'
    },
    total: {
      value: 20.99,
      currency: 'USD'
    },
    quantity: 1,
    discount: {
      value: 2.00,
      currency: 'USD'
    },
    tax: {
      value: 6.00,
      currency: 'USD'
    },
    shippingPrice: {
      value: 4.00,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 9.99,
      currency: 'USD'
    }
})

ecBasketItem

Emitted for every line item in a basket shown to the user either as an inline mini basket or in a view that only shows the basket.

If the user’s basket is changed in any way, events representing each line item are emitted again.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the basket value before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.subtotalIncludingTax.value (Number)

Reports the basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

The basket total after the application of discounts, promotions, shipping costs, etc

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The total number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The selected or default shipping price

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

product.sku (String)

SKU to uniquely identify the product

product.productId (String)

The product Id - this is the same for different styles and sizes

product.name (String)

The product name

product.stock (Number)

The number of available units

product.color (String)

The product’s color

product.size (String)

The product’s size

product.price.value (Number)

The price of the product after any discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.originalPrice.value (Number)

The price the product was originally sold at, before discounts, promotions, etc

product.originalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

A description of the product

product.manufacturer (String)

The manufacturer of the product

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

The product’s images

quantity (Number)

The number of products described by the line item

subtotalIncludingTax.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc

subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

subtotal.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc

subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

Example JavaScript

uv.emit('ecBasketItem',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 900.00,
      currency: 'USD'
    },
    total: {
      value: 1260.00,
      currency: 'USD'
    },
    quantity: 6,
    discount: {
      value: 100.00,
      currency: 'USD'
    },
    tax: {
      value: 46.00,
      currency: 'USD'
    },
    shippingPrice: {
      value: 30.00,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 946.00,
      currency: 'USD'
    }
  },
  product: {
    sku: 'DRESS101',
    productId: 1234,
    name: 'Red Cocktail Dress',
    stock: 20,
    color: 'Red',
    size: 12,
    price: {
      value: 200.00,
      currency: 'USD'
    },
    originalPrice: {
      value: 250.00,
      currency: 'USD'
    },
    url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
    description: 'This red cocktail dress is perfect for any occasion.',
    manufacturer: 'Dress Inc',
    categories: [
      'Dresses',
      'Cocktail Dresses',
      'Red'
    ],
    images: [
      'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
      'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
    ]
  },
  quantity: 2,
  subtotalIncludingTax: {
    value: 400.00,
    currency: 'USD'
  },
  subtotal: {
    value: 364.00,
    currency: 'USD'
  },
})

ecBasketItemAction

Emitted for every interaction with the basket, using the action field to specify whether a line item was added or removed. The event should also contain the summary for the full basket. This denormalization is essential for query performance.

After emitting one or more ecBasketItem events, a ecBasketSummary event should be emitted. If item level detail is not known, it is acceptable to emit just an ecBasketSummary event without any ecBasketItemevents.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The total number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The selected or default shipping price

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.sku (String)

SKU to uniquely identify the product

product.productId (String)

The product Id - this is the same for different styles and sizes

product.name (String)

The product name

product.stock (Number)

The number of available units

product.color (String)

The product’s color

product.price.value (Number)

The price of the product after any discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.originalPrice.value (Number)

The price the product was originally sold at, before discounts, promotions, etc

product.originalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

The product’s description

product.manufacturer (String)

The manufacturer of the product

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

The product’s images

quantity (Number)

The number of products described by the line item

subtotalIncludingTax.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc

subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

subtotal.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc

subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

action (String)

The action performed by the user on the described line item

Example JavaScript

uv.emit('ecBasketItemAction',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 9.99,
      currency: 'USD'
    },
    total: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: 10,
    discount: {
      value: 9.99,
      currency: 'USD'
    },
    tax: {
      value: 9.99,
      currency: 'USD'
    },
    shippingPrice: {
      value: 9.99,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 9.99,
      currency: 'USD'
    }
  },
  product: {
    sku: 'DRESS101',
    productId: 1234,
    name: 'Red Cocktail Dress',
    stock: 20,
    color: 'Red',
    size: 12,
    price: {
      value: 9.99,
      currency: 'USD'
    },
    originalPrice: {
      value: 9.99,
      currency: 'USD'
    },
    url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
    description: 'This red cocktail dress is perfect for any occasion.',
    manufacturer: 'Dress Inc',
    categories: [
      'Dresses',
      'Cocktail Dresses',
      'Red'
    ],
    images: [
      'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
      'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
    ]
  },
  quantity: 2,
  subtotalIncludingTax: {
    value: 400.00,
    currency: 'USD'
  },
  subtotal: {
    value: 9.99,
    currency: 'USD'
  },
  'action': 'add'
})

ecBasketItemTransaction

Transaction events are very important because they report revenue for your website. They are set up in a similar way to basket events except they should only be set up on an order summary page and they must include transaction.id.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The total number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The selected or default shipping price

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.sku (String)

SKU to uniquely identify the product

product.productId (String)

The product Id - this is the same for different styles and sizes

product.name (String)

The product name

product.stock (Number)

The number of available units

product.color (String)

The product’s color

product.price.value (Number)

The price of the product after any discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.originalPrice.value (Number)

The price the product was originally sold at, before discounts, promotions, etc

product.originalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

The product’s description

product.manufacturer (String)

The manufacturer of the product

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

The product’s images

quantity (Number)

The number of products described by the line item

subtotalIncludingTax.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc

subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

subtotal.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc

subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

transaction.id (String)

A unique Id to identify the transaction

transaction.firstTransaction (Boolean)

True if it’s the first time the visitor has transacted

transaction.paymentType (String)

The method used to pay for the transaction

transaction.billingAddress.addresee (String)

The full name of the transactor

transaction.billingAddress.company (String)

The company name if the transactor is not a person

transaction.billingAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.billingAddress.locality (String)

The billing address town or city

transaction.billingAddress.region (String)

The billing address region

transaction.billingAddress.postalCode (String)

The billing address postcode or equivalent (for example, zip code)

transaction.billingAddress.country (String)

The billing address country

transaction.billingAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the billing address

transaction.parentId (String)

If the transaction is an amendment to a previous transaction, emit the Id of the parent transaction

transaction.deliveryAddress.addresee (String)

The full name of the transactor

transaction.deliveryAddress.company (String)

The company name if the transactor is not a person

transaction.deliveryAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.deliveryAddress.locality (String)

The delivery address town or city

transaction.deliveryAddress.region (String)

The delivery address region

transaction.deliveryAddress.postalCode (String)

The delivery address postcode or equivalent (for example, zip code)

transaction.deliveryAddress.country (String)

The delivery address country

transaction.deliveryAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the delivery address

transaction.collectionStore.address.addresee (String)

The full name of person collecting the items

transaction.collectionStore.address.company (String)

The name of the store selected for collection

transaction.collectionStore.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.collectionStore.address.locality (String)

The store town or city

transaction.collectionStore.address.region (String)

The store region

transaction.collectionStore.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

transaction.collectionStore.address.country (String)

The store country

transaction.collectionStore.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

Example JavaScript

uv.emit('ecBasketItemTransaction',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 200.00,
      currency: 'USD'
    },
    total: {
      value: 250.00,
      currency: 'USD'
    },
    quantity: 10,
    discount: {
      value: 25.00,
      currency: 'USD'
    },
    tax: {
      value: 40.00,
      currency: 'USD'
    },
    shippingPrice: {
      value: 12.00,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 250.00,
      currency: 'USD'
    }
  },
  product: {
    sku: 'DRESS101',
    productId: 1234,
    name: 'Red Cocktail Dress',
    stock: 20,
    color: 'Red',
    size: 12,
    price: {
      value: 200.00,
      currency: 'USD'
    },
    originalPrice: {
      value: 225.00,
      currency: 'USD'
    },
    url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
    description: 'This red cocktail dress is perfect for any occasion.',
    manufacturer: 'Dress Inc',
    'category': [
      'Dresses',
      'Cocktail Dresses',
      'Red'
    ],
    images: [
      'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
      'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
    ],
  },
  quantity: 1,
  subtotalIncludingTax: {
    value: 240.00,
    currency: 'USD'
  },
  subtotal: {
    value: 212.00,
    currency: 'USD'
  },
  transaction: {
    id: '83748372',
    firstTransaction: true,
    paymentType: 'paypal',
    billingAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    parentId: 83748371,
    deliveryAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    collectionStore: {
      id: '12424',
      address: {
        addressee: 'John Smith',
        company: 'Amce Inc',
        lines: [
          'Flat 12',
          '123 High Street'
        ],
        locality: 'London',
        region: 'New York',
        postalCode: '10010',
        country: 'United States',
        countryCode: 'US'
      }
    }
  }
})

ecBasketSummary

Emitted each time the basket is shown to the user either as an inline minibasket or in a view that shows only the basket. If the user’s basket is changed in any way, the summary is emitted again.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The total number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The shipping cost added to the basket

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the value of the basket after the application of taxes, but before any discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

Example JavaScript

uv.emit('ecBasketSummary',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 150.00,
      currency: 'USD'
    },
    total: {
      value: 190.00,
      currency: 'USD'
    },
    quantity: 10,
    discount: {
      value: 10.00,
      currency: 'USD'
    },
    tax: {
      value: 30.00,
      currency: 'USD'
    },
    shippingPrice: {
      value: 10.00,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 180.00,
      currency: 'USD'
    }
  }
})

ecBasketTransactionSummary

Emit an ecBasketTransactionSummary event on the order summary page after ecBasketItemTransaction events. The event must include transaction.id and basket.subtotal and basket.total.

Example schema

Field (JS Data Type) Description

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The total number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The selected or default shipping price

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.sku (String)

SKU to uniquely identify the product

product.productId (String)

The product Id - this is the same for different styles and sizes

product.name (String)

The product name

product.stock (Number)

The number of available units

product.color (String)

The product’s color

product.price.value (Number)

The price of the product after any discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.originalPrice.value (Number)

The price the product was originally sold at, before discounts, promotions, etc

product.originalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

The product’s description

product.manufacturer (String)

The manufacturer of the product

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

The product’s images

quantity (Number)

The number of products described by the line item

subtotalIncludingTax.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc

subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

subtotal.value (Number)

The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc

subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

transaction.id (String)

A unique Id to identify the transaction

transaction.firstTransaction (Boolean)

True if it’s the first time the visitor has transacted

transaction.paymentType (String)

The method used to pay for the transaction

transaction.billingAddress.addresee (String)

The full name of the transactor

transaction.billingAddress.company (String)

The company name if the transactor is not a person

transaction.billingAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.billingAddress.locality (String)

The billing address town or city

transaction.billingAddress.region (String)

The billing address region

transaction.billingAddress.postalCode (String)

The billing address postcode or equivalent (for example, zip code)

transaction.billingAddress.country (String)

The billing address country

transaction.billingAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the billing address

transaction.parentId (String)

If the transaction is an amendment to a previous transaction, emit the Id of the parent transaction

transaction.deliveryAddress.addresee (String)

The full name of the transactor

transaction.deliveryAddress.company (String)

The company name if the transactor is not a person

transaction.deliveryAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.deliveryAddress.locality (String)

The delivery address town or city

transaction.deliveryAddress.region (String)

The delivery address region

transaction.deliveryAddress.postalCode (String)

The delivery address postcode or equivalent (for example, zip code)

transaction.deliveryAddress.country (String)

The delivery address country

transaction.deliveryAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the delivery address

transaction.collectionStore.address.addresee (String)

The full name of person collecting the items

transaction.collectionStore.address.company (String)

The name of the store selected for collection

transaction.collectionStore.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.collectionStore.address.locality (String)

The store town or city

transaction.collectionStore.address.region (String)

The store region

transaction.collectionStore.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

transaction.collectionStore.address.country (String)

The store country

transaction.collectionStore.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

Example JavaScript

uv.emit('ecBasketTransactionSummary',{
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 9.99,
      currency: 'USD'
    },
    total: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: 10,
    discount: {
      value: 9.99,
      currency: 'USD'
    },
    tax: {
      value: 9.99,
      currency: 'USD'
    },
    shippingPrice: {
      value: 9.99,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 9.99,
      currency: 'USD'
    }
  },
  transaction: {
    id: '83748372',
    firstTransaction: true,
    paymentType: 'paypal',
    billingAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    parentId: 83748371,
    deliveryAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    collectionStore: {
      id: '12424',
      address: {
        addressee: 'John Smith',
        company: 'Amce Inc',
        lines: [
          'Flat 12',
          '123 High Street'
        ],
        locality: 'London',
        region: 'New York',
        postalCode: '10010',
        country: 'United States',
        countryCode: 'US'
      }
    }
  }
})

ecFilterCriteria

Emitted on listing and search result views to report the filters applied and the sorting.

On search views, the event is emitted with the name: 'search', operator: 'equal', and value: '[entered search term]':

name: 'search',
operator: 'equal',
value: 'shoes'

On category views, for each category the view falls under, the event is emitted with the name :'category', operator: 'equal', and value: '[category name]':

name: 'adidas',
operator: 'equal',
value: 'trainers'

Ranges are modelled by emitting the upper and lower bound as separate filter criteria events, setting the operator as greater than or less than.

When users add, remove or change a filter, a new view event is emitted followed by all filter criteria that are still active after the change.

Example schema

Field (JS Data Type) Description

summary.pagination (Number)

The number of items shown per page to the visitor

summary.resultCount (Number)

The number of items that match the current query and/or filters. Should be more than or equal to the number of items shown to the visitor

summary.layout (String)

The visitors’s chosen visual layout of the listing (for example, list, grid or map)

summary.sortBy (String)

The column used to sort results

summary.sortDirection (String)

The selected sort direction

name (String)

The name of criteria used to sort results, for example, shoe size, price, brands, airlines. Should be category on category pages and search on search pages

operator (String)

The selected filter operator (for example, equal, not equal, greater than or less than)

value (String)

On search views, this is the entered search term, on category views this is the name of the category

Example JavaScript

uv.emit('ecFilterCriteria',{
  summary: {
    pagination: 1,
    resultCount: 20,
    layout: 'list',
    sortBy: 'price',
    sortDirection: 'descending'
  },
  name: 'price',
  operator: 'less than',
  total: '100'
})

ecFormSubmission

Emitted when a user submits a form.

Example schema

Field (JS Data Type) Description

submissionId (String)

A unique form Id

name (String)

The form name

Example JavaScript

uv.emit('ecFormSubmission',{
  submissionId: 'Form-0001',
  name: 'ContactUsEnquiry'
})

ecInteraction

Emitted to track user interaction for certain elements on the page. These events are not emitted for all interactions on all elements, only those that are of interest.

Example schema

Field (JS Data Type) Description

type (String)

The interaction type (for example, click, view, hover, download, share)

name (String)

A meaningful name unique to the interaction event

Example JavaScript

uv.emit('ecInteraction',{
  type: 'click',
  name: 'TopNavHomeButton'
})

ecProduct

Product events report a product loaded on a page. This could be, for example, a main product, a linked product on a product detail page, a product in a listing page, or search page.

Example schema

Field (JS Data Type) Description

eventType (String)

The type of product event (for example, listing, detail, linked_product, recommendation)

product.sku (String)

Unique product identifier

product.productId (String)

A unique Id to identify a product and all of its size, color, pattern, material, age, group, gender variants

product.name (String)

The product’s name, which should match the name shown on the product page

product.stock (Number)

The number of available units in stock

product.price.value (Number)

The price of the product after discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.OriginalPrice.value (Number)

The price of the product before discounts, promotions, etc, rounded to 2 decimal places

product.OriginalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

An accurate description of the product, which should match the description on the product page

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

An array containing the URLs of the product’s images. The main image you want to use to display the product must be the first element in the array

product.rating (Number)

Average rating for the product, between 0 and 1

product.reviewCount (Number)

Number of reviews submitted for the product

product.gender (String)

The target gender for the product

product.clearance (Boolean)

Whether the product is a clearance item

product.onSale (Boolean)

Whether the product is currently on sale

product.manufacturer (String)

The product manufacturer, recommended when a product inventory includes multiple brands

product.color (String)

The color of the product

product.size (String)

The size of the product (for example, 12, M, XL, 44)

Example JavaScript

uv.emit('ecProduct', {
  eventType: 'detail',
  product: {
    sku: 'sso-099',
    productId: '1209012233',
    name: 'Red cocktail dress',
    stock: 20,
    price: {
      value: 34.00,
      currency: 'GBP'
          },
    originalPrice:{
      value: 50.00,
      currency: 'GBP'
    },
    url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
    description: 'This red cocktail dress is perfect for any occasion.',
    categories: [
      'Clothing > Sweaters > Short Sleeve Sweaters',
      'New Arrivals > Clothing'
    ],
    images: [
      'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
      'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
    ],
    rating: 0.5,
    reviewCount: 10,
    gender: 'unisex',
    clearance: true,
    onSale: false,
    manufacturer: 'XYZ dresses',
    color: 'red',
    size: '12'
  }
})

ecProductRecommendation

Emitted for every product that is recommended to a user, in most cases as a related item to a recently viewed product.

Example schema

Field (JS Data Type) Description

eventType (String)

The type of product event (for example, listing, detail, linked_product, recommendation)

product.sku (String)

Unique product identifier

product.productId (String)

A unique Id to identify a product and all of its size, color, pattern, material, age, group, gender variants

product.name (String)

The product’s name, which should match the name shown on the product page

product.stock (Number)

The number of available units in stock

product.price.value (Number)

The price of the product after discounts, promotions, etc, rounded to 2 decimal places

product.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.OriginalPrice.value (Number)

The price of the product before discounts, promotions, etc, rounded to 2 decimal places

product.OriginalPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

product.url (String)

The URL of the product’s page

product.description (String)

An accurate description of the product, which should match the description on the product page

product.categories (Array of Strings)

A list of one or more product categories the product belongs to. Each category is a full category path, with each level separated by >

product.images (Array of Strings)

An array containing the URLs of the product’s images. The main image you want to use to display the product must be the first element in the array

product.rating (Number)

Average rating for the product, between 0 and 1

product.reviewCount (Number)

Number of reviews submitted for the product

product.gender (String)

The target gender for the product

product.clearance (Boolean)

Whether the product is a clearance item

product.onSale (Boolean)

Whether the product is currently on sale

product.manufacturer (String)

The product manufacturer, recommended when a product inventory includes multiple brands

product.color (String)

The color of the product

product.size (String)

The size of the product (for example, 12, M, XL, 44)

rank (Number)

A rank between 0 and 1, 0 being the first shown or highest ranking recommendation

Example JavaScript

uv.emit('ecProductRecommendation', {
  product: {
   name: 'Red cocktail dress',
   productId: '2761',
   sku: '190738103514',
   size: '0',
   color: 'Black',
   url: '/red-cocktail-dress.html',
   description: 'This red cocktail dress is perfect for any occasion.',
   manufacturer: 'XYZ Dresses',
   stock: 2,
   price: {
     currency: 'USD',
     value: 228
   },
   originalPrice: {
     currency: 'USD',
     value: 325
   },
   categories: [
     'Clothing > Sweaters > Short Sleeve Sweaters',
     'New Arrivals > Clothing'
   ],
   images: [
     'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
     'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
   ],
   onSale: true,
   rating: 0.5,
   reviewCount: 10,
   gender: 'unisex',
   clearance: true,
  },
 eventType: 'recommendation',
 rank: 0.5,
})

ecRecommendation

Example schema

Field (JS Data Type) Description

id (String)

Version and/or segment identifier

skus (Array of Strings)

An array of recommended product SKUs

Example JavaScript

uv.emit('ecRecommendation',{
  id: 'lookalike',
  skus: [
    'DRESS101',
    'DRESS102',
    'DRESS501'
  ]
})

ecStore

A representation of a physical store.

Example schema

Field (JS Data Type) Description

id (String)

Unique Id to identify the store

store.address.addressee (String)

Full name of the person for whom the address is for

store.address.company (String)

The name of the store returned by the query

store.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

store.address.locality (String)

The store town or city

store.address.region (String)

The store region

store.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

store.address.country (String)

The store country

store.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

Example Javascript

uv.emit('ecStore',{
  store: {
    id: '12424',
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    }
  }
})

ecStoreLocator

Emitted when a user runs a query on the store locater. store is not emitted if the query doesn’t return any results.

Example schema

Field (JS Data Type) Description

type (String)

Type of query entered, if the visitor can query from different fields (for example, postcode, street address, city)

query (String)

The query entered by the visitor

id (String)

Unique Id to identify the store

store.address.addressee (String)

Full name of the person for whom the address is for

store.address.company (String)

The name of the store returned by the query

store.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

store.address.locality (String)

The store town or city

store.address.region (String)

The store region

store.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

store.address.country (String)

The store country

store.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

Example JavaScript

uv.emit('ecStoreLocator',{
  type: 'zipcode',
  query: 10010,
  store: {
    id: '12424',
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    }
  }
})

ecUser

The ecUser event is emitted once per view and reports user metadata. The event should be emitted on every page as long as there is data available for the user.

For many sites, the event will be present and well populated when the user logs on.

Sites, with a newsletter subscription form that the user has previously submitted, might be able to populate the name and user address for the user using the data collected on form submission. Similarly, it might be possible to populate these values from a confirmation page.

Example schema

Field (JS Data Type) Description

user.id (String)

A unique Id assigned to the user. Could be a hash of the username and/or email address

user.title (String)

The user’s title

user.firstName (String)

The user’s first name

user.lastName (String)

The user’s last name

user.username (String)

The user’s username

user.email (String)

The user’s primary email address

user.firstSession (Boolean)

True if it’s the user’s first session

user.hasTransacted (Boolean)

True if the user has completed 1 or more transactions

loyalty.id (String)

Loyalty program membership number

loyalty.tier (String)

The level of the loyalty program this user holds

loyalty.tierPoints (Number)

The number of tier points

loyalty.membershipType (String)

The type of loyalty membership

loyalty.membershipPoints (Number)

The number of points from this membership

address.addresee (String)

The full name of person collecting the items

address.company (String)

The name of the store selected for collection

address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

address.locality (String)

The store town or city

address.region (String)

The store region

address.postalCode (String)

The store postcode or equivalent (for example, zip code)

address.country (String)

The store country

address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

user.isGuest (Boolean)

True if the user is a guest user without a registered account

user.age (Number)

The user’s age in years

user.phoneNumber (Number)

The user’s phone number, formatted without spaces, brackets, or hyphens

user.countryCallingCode

The country calling code for the given phone number, formatted to include the + prefix, as per ITU-T recommended standard E.123

user.device (String)

Device the user is browsing on (for example, kiosk)

Example JavaScript

uv.emit('ecUser', {
  user: {
    id: 'js123xyz',
    title: 'Mr',
    firstName: 'John',
    lastName: 'Smith',
    gender: 'male',
    username: 'johnsmith',
    email: 'johnsmith@testmail.com',
    firstSession: false,
    hasTransacted: true,
    loyalty: {
      id: '8989752-223',
      tier: 'silver',
      tierPoints: 20,
      membershipType: 'Clearsky Rewards',
      membershipPoints: 55
    },
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    isGuest: false,
    age: 42,
    phoneNumber: 01438812644,
    countryCallingCode: +44,
    device: 'kiosk'
  }
})

ecUserLogin

Emitted when a user logs in.

Example schema

Field (JS Data Type) Description

user.id (String)

A unique Id assigned to the user. Could be a hash of the username and/or email address

user.title (String)

The user’s title

user.firstName (String)

The user’s first name

user.lastName (String)

The user’s last name

user.username (String)

The user’s username

user.email (String)

The user’s primary email address

user.firstSession (Boolean)

True if it’s the user’s first session

user.hasTransacted (Boolean)

True if the user has completed 1 or more transactions in their lifetime

loyalty.id (String)

Loyalty program membership number

loyalty.tier (String)

The level of the loyalty program this user holds

loyalty.tierPoints (Number)

The number of tier points

loyalty.membershipType (String)

The type of loyalty membership

loyalty.membershipPoints (Number)

The number of points from this membership

address.addresee (String)

The full name of person collecting the items

address.company (String)

The name of the store selected for collection

address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

address.locality (String)

The store town or city

address.region (String)

The store region

address.postalCode (String)

The store postcode or equivalent (for example, zip code)

address.country (String)

The store country

address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

user.isGuest (Boolean)

True if the user is a guest user without a registered account

user.age (Number)

The user’s age in years

user.phoneNumber (Number)

The user’s phone number, formatted without spaces, brackets, or hyphens

user.countryCallingCode

The country calling code for the given phone number, formatted to include the + prefix, as per ITU-T recommended standard E.123

user.device (String)

Device the user is browsing on (for example, kiosk)

firstLogin (Boolean)

True if this is the first time the user has logged in

Example JavaScript

uv.emit('ecUserLogin',{
  user: {
    id: 'js123xyz',
    title: 'Mr',
    firstName: 'John',
    lastName: 'Smith',
    gender: 'male',
    username: 'johnsmith',
    email: 'johnsmith@testmail.com',
    firstSession: false,
    hasTransacted: true,
    loyalty: {
      id: '8989752-223',
      tier: 'silver',
      tierPoints: 20,
      membershipType: 'Clearsky Rewards',
      membershipPoints: 55
    },
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    isGuest: false,
    age: 42,
    phoneNumber: 01438812644,
    countryCallingCode: +44,
    device: 'kiosk'
  },
  firstLogin: true
})

ecUserSignup

Emitted when a user signs up for a newsletter or event.

Example schema

Field (JS Data Type) Description

user.id (String)

A unique Id assigned to the user. Could be a hash of the username and/or email address

user.title (String)

The user’s title

user.firstName (String)

The user’s first name

user.lastName (String)

The user’s last name

user.username (String)

The user’s username

user.email (String)

The user’s primary email address

user.firstSession (Boolean)

True if it’s the user’s first session

user.hasTransacted (Boolean)

True if the user has completed 1 or more transactions over their lifetime

loyalty.id (String)

Loyalty program membership number

loyalty.tier (String)

The level of the loyalty program this user holds

loyalty.tierPoints (Number)

The number of tier points

loyalty.membershipType (String)

The type of loyalty membership

loyalty.membershipPoints (Number)

The number of points from this membership

address.addresee (String)

The full name of person collecting the items

address.company (String)

The name of the store selected for collection

address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

address.locality (String)

The store town or city

address.region (String)

The store region

address.postalCode (String)

The store postcode or equivalent (for example, zip code)

address.country (String)

The store country

address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

user.isGuest (Boolean)

True if the user is a guest user without a registered account

user.age (Number)

The user’s age in years

user.phoneNumber (Number)

The user’s phone number, formatted without spaces, brackets, or hyphens

user.countryCallingCode

The country calling code for the given phone number, formatted to include the + prefix, as per ITU-T recommended standard E.123

user.device (String)

Device the user is browsing on (for example, kiosk)

type (String)

What the user has signed up for

name (String))

A meaningful name unique to the sign up

Example JavaScript

uv.emit('ecUserSignup',{
  user: {
    id: 'js123xyz',
    title: 'Mr',
    firstName: 'John',
    lastName: 'Smith',
    gender: 'male',
    username: 'johnsmith',
    email: 'johnsmith@testmail.com',
    firstSession: false,
    hasTransacted: true,
    loyalty: {
      id: '8989752-223',
      tier: 'silver',
      tierPoints: 20,
      membershipType: 'Clearsky Rewards',
      membershipPoints: 55
    },
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    isGuest: false,
    age: 42,
    phoneNumber: 01438812644,
    countryCallingCode: +44,
    device: 'kiosk'
  },
  type: 'newsletter',
  name: 'loyaltyaccount'
})

ecView

The ecView event reports a page view and is a special event because it is required by smartserve.js for data collection and processing. It’s therefore essential that every page emits an ecView event and that it is emitted before any other event.

Warning

Any CEH events emitted before the first ecView event are considered invalid. Web and mobile applications emit CEH view events whenever a view is rendered.

Example schema

Field (JS Data Type) Description

type (String)

Reports the page type (for example, home, category, search, product, basket, checkout, confirmation, help, contact, registration, content, account, or other)

subtypes (Array of Strings)

An unordered list of subtypes to describe the view

environment (String)

Reports the environment, that is, development, staging, or production

id (String)

Unique Id to identify the store

store.address.addressee (String)

Full name of the person for whom the address is for

store.address.company (String)

The name of the store returned by the query

store.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

store.address.locality (String)

The store town or city

store.address.region (String)

The store region

store.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

store.address.country (String)

The store country

store.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

language (String)

The language used to render the page in this view, which must be an IETF language tag

country (String)

The selected country for the view, which must be an ISO 3166-1 alpha-2 code (for example, GB, FR, US)

siteVersion (String)

The selected site version for the view (for example, desktop, mobile, tablet)

currency (String)

The ISO 4217 currency code for the user (for example, GBP, USD)

Example JavaScript

uv.emit('ecView',{
  type: 'category',
  subtypes: [
    'Womens',
    'Dresses',
    'Cocktail Dresses'
  ],
  environment: 'production',
  store: {
    id: '12424',
    address: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    }
  },
  language: 'English',
  country: 'United Kingdom',
  siteVersion: 'desktop',
  currency: 'USD'
})

ecVoucher

Emitted when a voucher code is entered.

Example schema

Field (JS Data Type) Description

entry (String)

The voucher code entered by the visitor

entrySuccess (Boolean)

Whether or not the voucher is successfully applied to the transaction. An entry must be valid to be successful

voucher.id (String)

A unique Id for the voucher associated with the entered code. Not set if the user enters an invalid string

voucher.label (String)

The name for the voucher associated with the entered code. Not set if the user enters an invalid string

transaction.id (String)

A unique Id to identify the transaction

transaction.firstTransaction (Boolean)

True if it’s the first time the visitor has transacted

transaction.paymentType (String)

The method used to pay for the transaction

transaction.billingAddress.addresee (String)

The full name of the transactor

transaction.billingAddress.company (String)

The company name if the transactor is not a person

transaction.billingAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.billingAddress.locality (String)

The billing address town or city

transaction.billingAddress.region (String)

The billing address region

transaction.billingAddress.postalCode (String)

The billing address postcode or equivalent (for example, zip code)

transaction.billingAddress.country (String)

The billing address country

transaction.billingAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the billing address

transaction.parentId (String)

If the transaction is an amendment to a previous transaction, emit the Id of the parent transaction

transaction.deliveryAddress.addresee (String)

The full name of the transactor

transaction.deliveryAddress.company (String)

The company name if the transactor is not a person

transaction.deliveryAddress.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.deliveryAddress.locality (String)

The delivery address town or city

transaction.deliveryAddress.region (String)

The delivery address region

transaction.deliveryAddress.postalCode (String)

The delivery address postcode or equivalent (for example, zip code)

transaction.deliveryAddress.country (String)

The delivery address country

transaction.deliveryAddress.countryCode (String)

An ISO 3166-1 alpha-2 country code for the delivery address

transaction.collectionStore.address.addresee (String)

The full name of person collecting the items

transaction.collectionStore.address.company (String)

The name of the store selected for collection

transaction.collectionStore.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country (maximum of 3 lines allowed)

transaction.collectionStore.address.locality (String)

The store town or city

transaction.collectionStore.address.region (String)

The store region

transaction.collectionStore.address.postalCode (String)

The store postcode or equivalent (for example, zip code)

transaction.collectionStore.address.country (String)

The store country

transaction.collectionStore.address.countryCode (String)

An ISO 3166-1 alpha-2 country code for the store

basket.id (String)

Unique basket Id

basket.subtotal.value (Number)

Reports the value of the basket before the application of taxes, discounts, promotions, shipping costs, etc

basket.subtotal.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.total.value (Number)

Reports the value of the basket after the application of taxes, discounts, promotions, shipping costs

basket.total.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.quantity (Number)

The number of items in the basket

basket.discount.value (Number)

The discount applied to the basket from vouchers or promotions

basket.discount.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.tax.value (Number)

The total tax applied to the basket

basket.tax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingPrice.value (Number)

The shipping cost added to the basket

basket.shippingPrice.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

basket.shippingMethod (String)

The selected or default shipping method

basket.subtotalIncludingTax.value (Number)

Reports the value of the basket after the application of taxes, but before any discounts, promotions, shipping costs, etc

basket.subtotalIncludingTax.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

Example JavaScript

uv.emit('ecVoucher',{
  entry: 12321,
  entrySuccess: true,
  voucher: {
    id: 'AO8734',
    label: 'SummerPromo'
  },
  transaction: {
    id: '83748372',
    firstTransaction: true,
    paymentType: 'paypal',
    billingAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    parentId: 83748371,
    deliveryAddress: {
      addressee: 'John Smith',
      company: 'Amce Inc',
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    collectionStore: {
      id: '12424',
      address: {
        addressee: 'John Smith',
        company: 'Amce Inc',
        lines: [
          'Flat 12',
          '123 High Street'
        ],
        locality: 'London',
        region: 'New York',
        postalCode: '10010',
        country: 'United States',
        countryCode: 'US'
      }
    }
  },
  basket: {
    id: 'BASK123',
    subtotal: {
      value: 200.00,
      currency: 'USD'
    },
    total: {
      value: 250.00,
      currency: 'USD'
    },
    quantity: 10,
    discount: {
      value: 25.00,
      currency: 'USD'
    },
    tax: {
      value: 40.00,
      currency: 'USD'
    },
    shippingPrice: {
      value: 12.00,
      currency: 'USD'
    },
    shippingMethod: 'Next Day',
    subtotalIncludingTax: {
      value: 250.00,
      currency: 'USD'
    }
  }
})