For example, if you want to do something only with a specific contact form (ID=123), use the detail.contactFormId property as seen in the following:
document.addEventListener( 'wpcf7submit', function( event ) {
if ( '123' == event.detail.contactFormId ) {
alert( "The contact form ID is 123." );
// do something productive
}
}, false );