CS E-commerce
Estimated reading: 2 minutes
If CampaignSuite is activated and the form makes a transaction, a Google E-commerce script will be added by default to the thank you message of the Gravity Forms form.
This code looks like this:
if(window.dataLayer !== undefined){
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'donatie',
'ecommerce': {
'purchase': {
'actionField': {
'id': 1234, //gravity forms entry ID
'revenue': 12.00, //totaal bedrag
'list': '',
'option': '',
'tax':'0',
'shipping': 0
},
'products': [{
'name' : 'Donatie',
'id': '1', //form ID
'price': 12.00,
'brand': '',
'category': 'One-time', //frequentie
'variant': 'Ideal', //payment method
'quantity': 1
}]
}
}
});
}JavaScript
In E-commerce settings you can set all fields of the E-commerce script. This option is often used with hidden fields in the form. The visitor does not see these fields, but you can have them pre-filled with values. You then link this to the E-commerce field in the settings.