You are able to use normal GA events calls. You will need to use the prefix __gaTracker not ga when using those calls.
So just to be sure, I replace ga with _gaTracker and it should send the events?
add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
function mycustom_wp_footer() {
?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
ga( ‘send’, ‘event’, ‘Contact Form’, ‘submit’ );
}, false );
</script>
<?php
}
Using __gaTracker will send the events. It’s hard to tell if that snippet specifically will work because I’m not familiar with contact form 7’s events but our paid version has a forms add-on in the Pro level that works with all forms plugins out of the box.
-Chris