Guest User

Untitled

a guest
Nov 17th, 2023
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <form id="form1" action="/submit-form" method="post">
  2. <!-- Form fields go here -->
  3. <input type="submit" value="Submit">
  4. </form>
  5.  
  6. <script>
  7. document.getElementById('form1').addEventListener('submit', function(event) {
  8. event.preventDefault();
  9. dataLayer.push({
  10. 'event': 'formSubmission',
  11. 'formLocation': 'Location A',
  12. });
  13. // Perform any additional form submission handling here
  14. // For example, you can submit the form data via AJAX.
  15. });
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment