Datalayer Rail Europe
unknown
plain_text
a year ago
2.3 kB
18
Indexable
window.dataLayer = window.dataLayer || [];
// Vue produit (view_item)
dataLayer.push({
'event': 'view_item',
'ecommerce': {
'items': [{
'item_id': 'SKU_12345', // ID du produit
'item_name': 'Billet Train Paris-Rome', // Nom du produit
'price': '59.99', // Prix du produit
'item_category': 'Billets de Train', // Catégorie
'item_variant': 'Economy', // Variante (si applicable)
}]
}
});
// Ajout au panier (add_to_cart)
dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': 'EUR',
'items': [{
'item_id': 'SKU_12345',
'item_name': 'Billet Train Paris-Rome',
'price': '59.99',
'quantity': 1
}]
}
});
// Début de checkout (begin_checkout)
dataLayer.push({
'event': 'begin_checkout',
'ecommerce': {
'items': [{
'item_id': 'SKU_12345',
'item_name': 'Billet Train Paris-Rome',
'price': '59.99',
'quantity': 1
}]
},
'user_info': {
'first_name': 'Jean',
'last_name': 'Dupont',
'email': 'jean.dupont@example.com'
}
});
// Ajout d'information de paiement (add_payment_info)
dataLayer.push({
'event': 'add_payment_info',
'ecommerce': {
'payment_type': 'Credit Card',
'items': [{
'item_id': 'SKU_12345',
'item_name': 'Billet Train Paris-Rome',
'price': '59.99',
'quantity': 1
}]
},
'user_info': {
'first_name': 'Jean',
'last_name': 'Dupont',
'email': 'jean.dupont@example.com'
}
});
// Achat (purchase)
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'T123456',
'affiliation': 'Rail Europe',
'value': 59.99, // Valeur totale de la transaction
'currency': 'EUR',
'tax': 5.00, // Taxe
'shipping': 3.50, // Frais de livraison
'coupon': 'SUMMER_SALE', // Coupon appliqué
'margin': 20.00, // Marge réalisée sur la vente
'items': [{
'item_id': 'SKU_12345',
'item_name': 'Billet Train Paris-Rome',
'price': '59.99',
'quantity': 1
}]
},
'user_info': {
'first_name': 'Jean',
'last_name': 'Dupont',
'email': 'jean.dupont@example.com'
}
});
Editor is loading...
Leave a Comment