1. Add or Remove products from Cart
Push data when a product is added to cart, or remove from cart
// Measure adding a product to a shopping cart
// and a list of product.
dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': 'EUR', // Currency code used for the PoS
'action':'add'
'items': [{
'item_name': 'Museum Pass', // Product Name
'item_id': '1234-567-987', // Unique SKU of the product item, i.e. product id - item id (if product is non-dated product) - performance id (if product is of event or parking or visit type) - seat category id - tarrif type id - timeslot id (if product is timeslot) - advantage id (if any) (same as enhanced e-commerce dataLayer)
'date':'03-01-2023 - 06:00' // Date time of performance/match
'price': '15.25', // Unit Price
'item_brand':'Visit Pass / Exhibition', // Product Family Type / Topic o
// Measure the removal of a product from a shopping cart.
dataLayer.push({
'event': 'remove_from_cart',
'ecommerce': {
'currency': 'EUR', // Currency code used for the PoS
'action':'remove'
'items': [{
'item_name': 'Museum Pass', // Product Name
'item_id': '1234-567-987', // Unique SKU of the product item, i.e. product id - item id (if product is non-dated product) - performance id (if product is of event or parking or visit type) - seat category id - tarrif type id - timeslot id (if product is timeslot) - advantage id (if any) (same as enhanced e-commerce dataLayer)
'price': '15.25', // Unit Price
'item_brand': 'Visit Pass / Exhibition', // Product Family Type / Topic of the product (if set) (same as enhanced e-commerce dataLayer)
'item_category':'Cat A', // Seat category
'item_category2':'Full price', // tarrif type
'item_variant': 'SALE',
'quantity': 1 // Quantity remove from t cart for this product item
'type': 'Sport', // Product Type
}]
}
});
2. View Cart
Push data when user views cart content
// Measure viewing a shopping cart
dataLayer.push({
'event': 'view_cart',
'ecommerce': {
'currency': 'EUR', // Currency code used for the PoS
'action':'add'
'items': [{
'item_name': 'Museum Pass', // Product Name
'item_id': '1234-567-987', // Unique SKU of the product item, i.e. p
3. Check out
Data are sent to datalayer in check out process with 3 steps: Begin the Checkout, Delivery and Order confirmation (after the payment page)
When user start the Check-out process (event 'begin_checkout')
<script>
dataLayer.push({
'event': 'begin_checkout',
'ecommerce': {
'step': 0, //check out step, (0: Begin, 1: Delivery, 2: Summary)
'id':15284, // File ID
'option':'begin_checkout'
},
'items': [{ //List of productFieldObjects inside the order.
'item_name': 'Triblend Android T-Shirt', //Product Name (mandatory).
'item_id': 12345, //Product Id (mandatory).
'date':'13-01-2023 - 05:00'
'price': '15.25', //Unit Price (mandatory) (same as the basic e-commerce tag).
'item_brand': 'Visit Pass / Exhibition', // Product Family Type / Topic of the product (if set)
'item_category':'Cat A', // Seat category
'item_category2':'Full price', // tarrif type
'item_variant': 'SALE',
'quantity': 1, // same as the basic e-commerce tag
'coupon': 'PartnerCUBE' // advantage name / advantage id
'type': 'Sport', // Product
When user choose a delivery mode and click on Continue (event 'add_shipping_info')
<script>
dataLayer.push({
'event': 'add_shipping_info',
'ecommerce': {
'step': 1, //check out step, (0: Begin, 1: Delivery, 2: Summary)
'id':15284, // File ID
'option':'summary' //order summary page - where the step 1 is pushed (additional information)
'shipmentID': 'E-ticket', //shipment mode name
'shipmentMode': 'E-ticket', //shipment mode name
'shipping': 8 //shipment fee
},
'items': [{ //List of productFieldObjects inside the order.
'item_name': 'Triblend Android T-Shirt', //Product Name (mandatory).
'item_id': 12345, //Product Id (mandatory).
'date':'13-01-2023 - 05:00'
'price': '15.25', //Unit Price (mandatory) (same as the basic e-commerce tag).
'item_brand': 'Visit Pass / Exhibition', // Product Family Type / Topic of the product (if set)
'item_category':'Cat A', // Seat category
'item_category2':'Full price', // tarrif type
'item_variant': 'SALE',
'quantity': 1, // same as the basic e-commerce tag
'coupon': 'PartnerCUBE' // advantage name / advantage id
'type': 'Sport', // Product Type
}]
}
}
});
</script>
When user input a voucher, select a payment method, then click on Continue to Payment (event 'add_payment_info')
<script>
dataLayer.push({
'event': 'add_payment_info',
'ecommerce':{
'checkout':{
'actionField':{
'step': 2, //check out step, (0: Begin, 1: Delivery, 2: Summary)
'option':'order-confirmation' //order confirmation page - where the step 2 is pushed (additional information)
'option': 'VISA', //selected payment method name
'id':1000463, //File ID
'shipmentID': '1111111', // shipment ID, get from Delivery step
'shipmentMode': 'E-ticket', // shipment mode name
'shipping': 8, //shipment fee
'payment fee': 4, //payment overhead fee
'revenue': 35, //total amount to pay
'coupon': 'PROMO' //promotional code or voucher code
},
'items': [{ // List of productFieldObjects inside the orde
When user completes an order (event 'purchase')
<script>
dataLayer.push({
'event': 'purchase',
'ecommerce':{
'checkout':{
'actionField':{
'transactionID': '1234', //file ID
'shipping': 8, //shipment fee
'payment fee': 4, //payment overhead fee
'affilication':'SHOP', //sales channel name
'tax': 4, //tax fee
'value': 35, //total amount to pay
'currency": 'EUR'
},
'items': [{ // List of productFieldObjects inside the order.
'item_name': 'Triblend Android T-Shirt', // Product Name (mandatory).
'item_id':12345, // Product Id (mandatory).
'date':'13-01-2023 - 05:00'
'price': '15.25', // Unit Price (mandatory) (same as the basic e-commerce tag).
'item_brand': 'Visit Pass / Exhibition', // Product Family Type / Topic of the product (if set)
'item_category':'Cat A', // Seat category
'item_category2':'Full price', // tarrif type
'item_variant': 'SALE',
'quantity': 1, // same as the basic e-commerce tag
'coupon': 'PartnerCUBE' // advantage name / advantage id
'type': 'Sport', // Product Type
}]
}
}
});
</script>