Hook into Successful Form Submission

I run Fathom analytics on a Bricks Site. I want to fire off a Fathom event when a form has been submitted.

Is there a way to hook into the successful form submission to then trigger a fathom js function?

Example fathom event:
fathom.trackGoal(‘YOUR-EVENT-ID’, 0);

Alternatively, could the “custom” form action be used to trigger JS on the front end?

Thanks,

John