Google Analytics event in Hubspot form on Hubspot platform


We are moving our landing pages from Wordpress across to Hubspot and I need to replicate our Google analytics event tracking.

This is the event that needs to trigger. ga(‘send’, ‘event’, ‘form’, ‘submit’, ‘dev_report’);

It needs to fire on the form on this landing page (hosted by hubspot) -

How do I insert that code in the HubSpot admin system?


Hi @Tristan_Boyd,

Since that form redirects to a file URL, you'll have to embed the Google Analytics event tracking tag within the form embed code.

While it's not possible to modify the embed code in the existing Form module, you can use a Custom HTML module instead. With access to the form's embed code, add the GA event within the onFormSubmit method, as outlined in this article.