Hello, Matt! Thanks for you answer!
I think, i forgot to mention that form can react in various ways: redirect to external site, redirect to current site's another page or just display text. So your suggestion works only in one way.
My custom web part wasn't go far away from original, it's really can be considered as default Kentico approach.
So my question can be slighly edited.
How can i integrate form submission event with Google Tag Manager? I didn't work too much with GTM - my task is to execute js code, when form is submitted.
The problem is when i'm trying to insert js code execution code (by ScriptManager class) into OnAfterSave event and "Redirect to url after form submission" is selected in form settings, this js code doesn't execute. It executes if only there is no redirection after form submission.
I'm sorry for a quite misunderstanding, hope this will clarify my situation.