# Send events to Google Analytics from inline form

**URL:** <https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209>\
**Category:** Lead Capture Tools\
**Created:** [September 14, 2018, 8:08am UTC](https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209 "2018-09-14T08:08:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johdah](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johdah/32/95715_2.png) [@johdah](https://community.hubspot.com/u/johdah)\
**Post date:** [September 14, 2018, 8:08am UTC](https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209/1 "2018-09-14T08:08:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jenny](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jenny/32/24_2.png) [@Jenny](https://community.hubspot.com/u/Jenny)\
**Post date:** [September 14, 2018, 7:15pm UTC](https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209/2 "2018-09-14T19:15:31Z")

</div>

Hi @johdah,

Have you seen [this resource](https://integrate.hubspot.com/t/trigger-google-analytics-event-with-form-submission/5793)? Let me know if that resolves the issue.

Thanks,  
Jenny

---

<div class="post-metadata">

**Author:** ![johdah](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johdah/32/95715_2.png) [@johdah](https://community.hubspot.com/u/johdah)\
**Post date:** [September 17, 2018, 7:52am UTC](https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209/3 "2018-09-17T07:52:26Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![Petya](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/petya/32/27089_2.png) [@Petya](https://community.hubspot.com/u/Petya)\
**Post date:** [May 15, 2020, 1:18pm UTC](https://community.hubspot.com/t/send-events-to-google-analytics-from-inline-form/10209/4 "2020-05-15T13:18:12Z")

</div>

Hi @johdah ,

Did you add this to the form embed code?

Best Regards,

Petya
