How to track form submission calculation field
-
[context]
Basically, I’m integrating google tag manager to track order form submission, which I will use to optimize my Google ads.
Now, I successfully track the form submission, but I want to include a value in the submission, which would be the total of the order.
This value would come from the calculation field in forminator.
——
I was watching this tutorial that shows how to do it for a order form, but he doesn’t show it for a order form with actual order total value.
This is the tracking script I am using in tag manager, which I guess decides what data layer to push in Tag manager?
<script>
/**
* Author: Md Hasanuzzamna
* Linkedin: https://linkedin.com/in/md-h
* Youtube: https://youtube.com/@leomeasure
* Email: [email protected]
*/
(function() {
function formDataToObject(formData) {
var object = {};
formData.forEach(function(value, key) {
object[key] = value;
});
return object;
}
jQuery(document).on('forminator:form:submit:success', function (e, formData) {
var formDataObject = formDataToObject(formData);
window.dataLayer = window.dataLayer || [];
dataLayer.push({
event: 'forminator_form_submit',
form_id: formDataObject.form_id,
inputs: formDataObject
});
});
})();
</script>n?Now, I don’t see how I can add the order total in the script, so it’s pushed to Google Tag Manager.
Thanks
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.