Triggering custom function on portal sign

Hey, I’m trying to integrate Plausible Analytics with the new membership portal and I was just wondering if anyone had a particularly good way of doing that.

Specifically what I want is for the function plausible('Signup') to run whenever somebody signs up on the membership portal, so that in my analytics I can identify the kinds of people who are actually signing up.

And of course one way to do that is a big mess of javascript with a ton of nested selectors that waits until everything is loaded and sneaks in an event listener on the ‘continue’ button, but I thought somebody here might know of a more elegant solution.