// Custom dimension to track the form name function formSubmitted() { // Get the form name from the form ID const formName = Cognito.getFormName(29);
// Create a custom dimension with the form name ga('set', 'dimension1', formName); }
// Attach the formSubmitted() function to the form's submit event document.getElementById('form').addEventListener('submit', formSubmitted);