Silverstripe Version: 3.2
Question: I have a demo for a script and I want someone to help with this script
Details of your query go here
// Include any relevant code. If you have a lot of code, link to a gist instead.
window.addEventListener("load",function(){
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345', // Transaction ID. Required for purchases and refunds.
'affiliation': 'Mob', // i.e. Donation site. e.g.
Mob, Donation, etc.
'revenue': '35.00', // Total transaction value (incl. tax and shipping)
'tax':'5.00'
},
'products': [{ // List of productFieldObjects.
'name': 'Donation - {{dynamic}}', // i.e. donation type monthly or single
'id': '12345',
'price': '30.00',
'brand': Donation',
'category': 'Donation',
'variant': 'Mob', // i.e. Donation site. e.g. Mob, Donation, etc.
'quantity': 1
}]
}
},
'donationType': '{{dynamic}}' //i.e. monthly or single
});
});