Forums

Tracking form abandonment

qmeister 19 Sep, 2013
Hi,

We have multiple forms throughout our site and would like to track form field interaction and form abandonment.

I've found this resource http://www.lunametrics.com/blog/2012/11/13/track-form-abandonment-google-analytics/#sr=g&m=o&cp=or&ct=-tmc&st=%28opu%20qspwjefe%29&ts=1378894208 which explains tracking for a single form using jquery but not sure how to apply to our specific situation with multiple forms.

Would be grateful if anyone can help with advice.

Thanks in advance
GreyHead 20 Sep, 2013
Hi qmeister,

Which version of Joomla! and ChronoForms are you using? If this is Joomla! 3 then the jQuery should work Ok, if it's an earlier version it might work OK.

And do you have multiple forms on the same page? If you do then some modification is needed to be clear which inputs belong to which form.

Bob
qmeister 25 Sep, 2013
Hi,

Thanks for your reply

It's Chronoforms 3 with Joomla 1.5. The forms aren't on the same page, they are dispersed throughout the site. I realise we need to differentiate between the forms so that was where I needed help adjusting the code in that reference site for the multi form case we have.

Thanks in advance
GreyHead 28 Sep, 2013
Hi qmeister,

If you load this version of the code in a Load JS action in each form it should work OK:
(function($) {
  $(document).ready(function() { 
    $(':input').blur(function () {
      var form_name = '<?php echo $form->form_details->name; ?>';
      if($(this).val().length > 0) {
        _gaq.push(['_trackEvent', form_name, 'completed', $(this).attr('name')]);
      } else {
        _gaq.push(['_trackEvent', form_name, 'skipped', $(this).attr('name')]);
    });
  });
})(jQuery);

Bob
This topic is locked and no more replies can be posted.