Is it possible to add tracking to Hubspot form submit button
Hello All,
Does anyone know if tracking code can be added to the submit button in aHubspot form? I've tried adding the tracking code using the onFormSubmit attribute but I'm not getting any tracking results for the submit button clicks. Maybe I have the code incorrectly formatted.? I've included my code below for reference. I've removed the portal and form ids for security reasons.
Is it possible to add tracking to Hubspot form submit button
Hi @Derek_Gervais Sorry the code was not displayed on the above thread i don't know why, I have modified the above thread and added the screenshot of the code.
We're using GTM for tracking everything. I don't know exactly how ga() works but with GTM our tracking works like this:
At the top of the page, a small script will make sure that dataLayer array is available: window.dataLayer = window.dataLayer || [];
Then anywhere in the code (in this case onFormSubmit event), we just do following: