Anybody pairing Hotjar tools with Unbounce pages? Does the “Form Analytics” feature work with Unbounce forms? Would you recommend it?
Anyone get successful form submits in HotJar? Anyone know how to override Unbounce’s form submission, so I can add the HotJar script they provide for manual submit tracking?
I have a working script thanks to the help of my developer pal at work. This should work on any page as long as the normal Hotjar script and this script load on your desired page. I prefer to do this through the Settings > Scripts menu.
<script type="text/javascript">
lp.jQuery(function($) {
function notifyHotjar() {
lp.jQuery('.lp-pom-form form').submit();
hj('formSubmit' + ($('.lp-pom-form form').valid() ? 'Successful' : 'Failed'));
}
$('.lp-pom-form .lp-pom-button')
.unbind('click tap touchstart')
.bind('click.formSubmit', notifyHotjar);
$('form')
.unbind('keypress')
.bind('keypress.formSubmit', function(e) {
if(e.which === 13 && e.target.nodeName.toLowerCase() !== 'textarea' ) {
notifyHotjar();
}
});
});
</script>
Best,
Brian
Brian this is awesome, thanks so much for sharing this!!
This is Tips & Scripts worthy - would you mind if we shared this in there?
-Jess
Go for it. I’d be curious to have some others try the script and also review it for any potential issues.
Reply
Log in to the Unbounce Community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.