APIs & Integrations

victoria7
Member

Sending qualification data with form submissions to Google Analytics

To get an MQL conversion rate in Google Analytics for form submissions on our site, we've been trying to include data from collected form fields with the submission so we can exclude certain job roles and existing customers from the conversion rate. We've partially done this by pushing the data from the fields to the data layer and using Google Tag Manager to push this to GA.

 

We've used Javascript to push the form data to the data layer, then created a GTM tag to collect this on a successful form submission. However, even though these form fields are compulsory, we're getting blank data and not getting as many conversions as we're seeing in Hubspot.

 

We believe there is an issue with the timing of the onFormSubmit and onFormSubmitted global events provided by Hubspot. These are described on https://developers.hubspot.com/global-form-events. They appear to be asynchronous events. When a form has a "thank you page" the events can fail to fire before the transition to the "thank you page" occurs. This makes any logic or downstream processing that we might wish to deploy unreliable. We would like to be able to delay the transition to the thank you page until the global events have fired. Could anyone advise on how we might guarantee that the onFormSubmit and onFormSubmitted events get a chance to fire, and transition could be delayed?

0 Upvotes
1 Reply 1
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Sending qualification data with form submissions to Google Analytics

Hi @victoria7 

 

Could you use Javascript, during the onFormSubmit, to push an event to Google Analytics?

 

I've used JavaScript in videos to trigger custom event – I assume you could trigger a conversion the same way.

 

This could remove the asynchrounous issues with Tag Manager.

 

Have fun

Mike

0 Upvotes