First, make sure that the DOM event is correctly fired. The event handler functions will be executed only when the event is fired.
Contact Form 7’s DOM events, such as
wpcf7submit, are fired in the process of an AJAX form submission. Therefore, when your contact form is working in non-AJAX submission mode, none of the events will be fired.