You can hook comment_post
and add your logic with the comment id
// Save the data along with comment id
add_action( 'comment_post', 'wti_save_comment_data' );
function wti_save_comment_data( $comment_id ) {
// Use the comment id and add your logic
}