Drupal 8 - Alter page attachments AFTER form submit
I see two ways of doing this. 

Options 1: Make the form Ajax. Either by using Form API in Drupal or Jquery. Then in success function call your custom js event. Or else you could also do something like this:

 $('#some-form-123').submit(function() {
    _gaq.push(['_trackEvent', 'Contactform', 'Form submitted']);
  });


The above code is an example, you need to use it for your event.

Option 2: In Drupal set a cookie when the form is submitted. Then in page load, check if the particular cookie exists. If it does exist invoke your custom event and unset the cookie. Then, the cookie is only present if the form is again submitted. 

See the following:


https://www.drupal.org/docs/8/api/javascript-api/ajax-forms
https://github.com/jquery-form/form
https://github.com/js-cookie/js-cookie