Send events to Google Analytics from inline form

Is there a way to send events to Google Analytics after submission of an inline form on HubSpot?
On an external page, using the Javascript-snippet, there is the possibility to run whatever javascript you need, but when adding a form on the HubSpot platform, I see no option to send events or add custom code anywhere. Am I missing something or is this not possible?

Hi @johdah,

Have you seen this resource? Let me know if that resolves the issue.

Thanks,
Jenny

No I hadn’t. Thanks for pointing me in the right direction!
For anyone else reading this, I’m posting the correct (in my case) answer here.
You can use the hsvalidatedsubmit event that fires after the form is validated.

In my case, I did this:

 $('body').on('hsvalidatedsubmit', '.hs-form', function (e) {
 ga('send', {
 hitType: 'X',
 eventCategory: 'Y',
 eventAction: 'Z',
 });
 });

Hi @johdah ,

Did you add this to the form embed code?

Best Regards,

Petya