Datalayer push when send a form
-
Hi team,
I use this script for one form, and it works perfectly.
<script> jQuery('form#forminator-module-51304').on('forminator:form:submit:success', function (e, formData) { let formDataOb = {}; for (const [key, value] of formData.entries()) { formDataOb[key] = value; } dataLayer.push({ 'event': 'test', 'formData': formDataOb, }); console.log('Test'); }); </script>
But I think, I need to create more forms, how should I modify it to take different forms?
The forms, for example form#forminator-module-51304 y form#forminator-module-51490, and the dataLayer.push different, ‘event’: ‘test’ and ‘event’: ‘test2’ for the second formThe page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Datalayer push when send a form’ is closed to new replies.