What's the best way to track form pages in GA?


(Pomster09) #1

Does anyone have thoughts of how to best track the different pages in a form? I'd like to use my google analytics account to track completed submissions verses incomplete. I imagine I could track my thank you page as completed. But is the thank you page track-able? Or do I need to place some custom code in the thank you page that gets passed to google?


(Bart Banda) #2

I would probably do it with custom event tracking: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

So on the thank you page body copy, you can just add some JS to tell google that a successful submission has been received, something like: _gaq.push(['_trackEvent', 'Forms', 'Submitted', '<NAME OF FORM>']);

 

Hope that helps.


(Pomster09) #3

Thanks Bart, I though I could also load in an iframe with a blank pre-titled page.


(Bart Banda) #4

Thanks Bart, I though I could also load in an iframe with a blank pre-titled page.

 

Yea you could do that as well, I guess it depends on how you want the stats to show in GA. 


(Pomster09) #5

I'm wanting to pull the stats into Squiz using a core Google Analytics API. All I'm after is a count of daily submissions so I can chart it over a 30 day period, so it doesn't really matter which way to collate that count.


(Pomster09) #6

I took your advice and went with the in-page code which works a treat.

<script>
(function($) {
    $(document).ready(function() {
        pageTracker._trackEvent('onlineForm', 'Submitted', 'myForm');
    });
})(jQuery);
</script>