Hello!
Has anyone successfully setup form field level tracking with an embedded hubspot form? For example tracking forms with: Hotjar, Mouseflow, VWO form report, clicktale, etc. Maybe even GA events.
abr 21, 20214:32 PM - editado dic 8, 202211:16 AM
Participante
Form field level analytics setup
> Basically you really have to wait for Hotjar and these other tools to support tracking forms that are rendered into the page via javascript …
Can't think of a better way than @derekcavaliero's answer to summarize this: the core challenge with tracking HubSpot forms is the way they are loaded — dynamically on the page by the JavaScript code.
That said, the wait is over!
To solve this, our team at Insiteful recently developed & released a custom tracking code that allows you to easily to track form fields & analytics from your existing HubSpot forms without changing much:
Simply replace your current HubSpot form embed code with the modified tracking code copied below.*
* Important: be sure to replace the placeholders for unique IDs ( ie. {{ YOUR HUBSPOT FORM ID }} ) in the code below with the appropriate values from HubSpot & Insiteful, respectively. The unique ID for HubSpot forms can be retrieved from the ‘formId’ attribute in the embed code (or even the editor URL) and the portal ID is just above it (read more here). Meanwhile, the Insiteful activation key is available when you login and navigate to the Install page.
The issue is that HubSpot renders the form into the page with JavaScript after the Hotjar (or any others) script has already loaded. In order to use the form field analytics inside Hotjar, the form needs to be on the page when the Hotjar script is loaded - otherwise it can’t find it.
The only way I think you could get around this would be to delay Hotjar from loading on the site until the form finishes rendering. However, this has more negative effects than positive - all of your recordings/heatmap data will be thrown off because of the delay - or the script may not function properly at all.
Basically you really have to wait for Hotjar and these other tools to support tracking forms that are rendered into the page via javascript - hacking something together like this may cause more harm than good.