Hi,
I’m facing the same issue and I suspect, I have the same mistake as you but I’m not sure, how to solve it exactly. Could you show your example?
This is the script that we implemented in the backend:
<script>
window._mtm = window._mtm || [];
window._mtm.push({ecommerce: null}); // Clear the previous ecommerce object.
window._mtm.push({
event: "purchase",
ecommerce: {
transaction_id: "000123", //gibt es sie? Ggf. Buchungszeit mitgeben
value: 1340,
currency: "EUR",
discount: false,
items: [
{
item_id: "0123456789", //gibt es sie? Kann ggf. weg
item_name: "Betrieb und Instandhaltung von Brandmeldeanlagen",
item_category: "Webinar", // oder vor Ort
item_modulnr: "B 1.0",
item_date: "15.10.2024",
price: 1340,
quantity: 1,
}
],
}
});
</script>
And this is the tag in matomo:
<script>
window._paq = window._paq || [];
var ecommerce = {{DL - ecommerce}};
// Product Array
ecommerce.items.forEach(function(item){
_paq.push(['addEcommerceItem',
item.item_id,
item.item_name,
item.item_modulnr,
item.item_date,
item.price,
(item.quantity || 1)
]);
});
// Push custom event
_paq.push(['trackEvent', 'Ecommerce', 'Purchase', '{{DL - item_name}}', {{DL - ecommerce.value}}]);
// Push ecommerce data
window._paq.push(['trackEcommerceOrder',
ecommerce.transaction_id,
ecommerce.value,
ecommerce.currency,
(ecommerce.discount || false)
]);
</script>
Where did you add the products?
I see ecommerce data, but the products reports are empty.
I’d really appreciate your help!