track form submission using DTM
I would like to track the form submission using DTM. If we use event based tracking how can I check if all the form fields are validated before tracking submission button? How these types of logic are added in DTM?
I would like to track the form submission using DTM. If we use event based tracking how can I check if all the form fields are validated before tracking submission button? How these types of logic are added in DTM?
Hi Vidya,
There's a couple of ways you could do this.
You need to ensure that the validation script is loaded before the submit button code. You can create another rule for this or add a sequential third party tag within the same rule
The other (slightly complex-er) method would be to use data elements. This data element will contain the value of the validation script i.e. T or F. Once this data element is set up, you can reference this in your original rule using custom scropt and check the value of the data element to fire your submit button rule accordingly.
I'd suggest trying the 1st method and if it doesn't work, use the 2nd (merely because the 1st one seems a little easier)
Let me know if this helps
Kind Regards
Rahul
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.