1. Add or Remove products from CartPush data when a product is added to cart, or remove from cart Code Block |
---|
language | js |
---|
title | Add to Cart DataLayer Example |
---|
collapse | true |
---|
| // Measure adding a product to a shopping cart
// and a list of product.
dataLayer.push({
'event': '{
"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 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 added to cart for this product item
'"url'": '"https://mosa.int1-shop.secutix.com/selection/timeslotpass?productId=101047223156' // URL pointing to the corresponding product item selection page which can be used by 3rd-party email retargeting tools
'imgUrl': 'https://mosa.int1-shop.secutix.com/api/1/dl/product/101047223156/logo' // Image URL of the corresponding product item which can be used by 3rd-party email retargeting tools
'type': 'Sport', // Product Type
}]
}
});' | Code Block |
---|
language | js |
---|
title | Remove from Cart DataLayer Example |
---|
collapse | true |
---|
| productId=101047223156" // URL pointing to the corresponding product item selection page which can be used by 3rd-party email retargeting tools
"imgUrl": "https://mosa.int1-shop.secutix.com/api/1/dl/product/101047223156/logo" // Image URL of the corresponding product item which can be used by 3rd-party email retargeting tools
"type": "Sport", // Product Type
}]
}
} |
Code Block |
---|
language | js |
---|
title | Remove from Cart DataLayer Example |
---|
collapse | true |
---|
| {
"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 CartPush data when user views cart content Code Block |
---|
language | js |
---|
title | View Cart DataLayer Example |
---|
collapse | true |
---|
| {
"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. 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 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 for this product item
"url": "https://mosa.int1-shop.secutix.com/selection/timeslotpass?productId=101047223156" // URL pointing to the corresponding product item selection page which can be used by 3rd-party email retargeting tools
"imgUrl": "https://mosa.int1-shop.secutix.com/api/1/dl/product/101047223156/logo" // Image URL of the corresponding product item which can be used by 3rd-party email retargeting tools
"type": "Sport", // Product Type
}]
}
} |
3. Check outData are sent to datalayer in check out process with 3 steps: Begin the Checkout, Delivery and Order confirmation (after the payment page) Info |
---|
title | Security and data layer |
---|
| Please note that the payment page cannot push any data in the data layer, as this is a secure page and pushing data externally in a secure page is forbidden by the PCI certification. |
When user start the Check-out process (event 'begin_checkout') Code Block |
---|
language | js |
---|
title | Begin Checkout DataLayer Example |
---|
collapse | true |
---|
| {
"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", // Measure the removal of a product from a shopping cart.
dataLayer.push({
'event': 'remove_from_cart',
'ecommerce': {
'currencyCode': 'EUR', // CurrencySeat 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
}]
}
}
|
When user choose a delivery mode and click on Continue (event 'add_shipping_info') Code Block |
---|
language | js |
---|
title | Delivery step DataLayer Example |
---|
collapse | true |
---|
| {
"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", 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' "item_variant": "SALE",
"quantity": 1, // same as the basic e-commerce tag
"coupon": "PartnerCUBE" // advantage name / advantage id
"type": "Sport", // Product Type
}]
}
}); |
2. Check outData are sent to datalayer in check out process with 2 steps: Delivery and Order confirmation (after the payment page) Info |
---|
title | Security and data layer |
---|
| Please note that the payment page cannot push any data in the data layer, as this is a secure page and pushing data externally in a secure page is forbidden by the PCI certification. |
When user input a voucher, select a payment method, then click on Continue to Payment (event 'add_payment_info')When user choose a delivery mode and click on Continue Code Block |
---|
language | js |
---|
title | Delivery Order summary step DataLayer Example |
---|
collapse | true |
---|
| <script>
dataLayer.push({
'"event'": '"add_shippingpayment_info'",
'"ecommerce'": {
'step'"step": 12, //check out step, (0: Begin, 1: Delivery, 2: Summary)
'id':15284, // File ID
'option':'summary'"option":"order-confirmation" //order summaryconfirmation page - where the ee-checkout step 12 is pushed (additional information) information)
"option": "VISA", //selected payment method name
"id":1000463, 'shipmentID': 'E-ticket', //shipment mode name File ID
'shipmentMode': 'E-ticket'"shipmentID": "1111111", // shipment mode name ID, get from Delivery step
'shipping': 8"shipmentMode": "E-ticket", // shipment fee
},mode name
'items'"shipping": [{8, //Listshipment of productFieldObjects inside the order.
fee
"paymentFee": 4, 'item_name': 'Triblend Android T-Shirt', //Productpayment Name (mandatory).
overhead fee
'item_id'"revenue": 1234535, //Producttotal amount Id (mandatory).to pay
'date':'13-01-2023 - 05:00'
'price': '15.25', "coupon": "PROMO" //Unitpromotional Pricecode (mandatory) (same as the basic e-commerce tag).
or voucher code
"items": [{ 'item_brand': 'Visit Pass / Exhibition', // ProductList Familyof TypeproductFieldObjects / Topicinside of the product (if set) order.
'item_category':'Cat A', // Seat category"item_name": "Triblend Android T-Shirt", // Product Name (mandatory).
'"item_category2':'Full price',id":12345, // tarrifProduct type Id (mandatory).
'item_variant': 'SALE', "date":"13-01-2023 - 05:00"
'quantity'"price": 1"15.25", // Unit Price (mandatory) (same as the basic e-commerce tag).
'coupon': 'PartnerCUBE' // advantage name / advantage id
'type': 'Sport', "item_brand": "Visit Pass / Exhibition", // Product Type
}]
}
}
});
</script> |
When user input a voucher, select a payment method, then click on Continue to Payment Code Block |
---|
language | js |
---|
title | Order summary step DataLayer Example |
---|
collapse | true |
---|
| <script>
dataLayer.push({
'event': 'add_payment_info',
'ecommerce':{
'checkout':{
'actionField':{
'step': 2Family Type / Topic of the product (if set)
"item_category":"Cat A", // Seat category
"item_category2":"Full price", // tarrif type
"item_variant": "SALE",
"quantity": 1, //check outsame step, (1: Delivery, 2: Summary)as the basic e-commerce tag
"coupon": "PartnerCUBE" 'option':'order-confirmation' //order confirmation page - where the step 2 is pushed (additional information) advantage name / advantage id
'option': 'VISA'"type": "Sport", //selected payment method name Product Type
}]
}
}
|
When user completes an order (event 'purchase') Code Block |
---|
language | js |
---|
title | Purchase DataLayer Example |
---|
collapse | true |
---|
| {
"event": "purchase",
"ecommerce":{
"transaction_ID": "1234"'id':1000463, //File ID
'shipmentID': '1111111', // shipment ID, get from Delivery step
'shipmentMode': 'E-ticket', // shipment mode name file ID
'"shipping'": 8, //shipment fee
'payment fee'"paymentFee": 4, //payment overhead fee
"affiliation":"SHOP", 'revenue': 35, //sales channel name
"tax": 4, //total amount to pay tax fee
'coupon'"value": 'PROMO'35, //promotionaltotal codeamount orto voucherpay code
}, "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>
|
Info |
---|
title | Customize 'purchase' event name |
---|
| The 'purchase' event name can be customized by using the config key config.googleanalytic.GA4purchase at point of sales > internet theme > configure label key.
Currently, this is the only event that provides this customization option. |
|