Question

I have a search form on my website with various checkboxes that filter your search results. I would like to add event tracking to the checkboxes to track which of them are used the most when users perform a search. We are currently not able to do this server side for various reasons so I would like to do it with GA.

Now I am aware that you can use an onChange to fire the Event when the check box is clicked, however the user may check and uncheck various boxes before they submit the form. This would result in multiple events being recorded. For this reason I would only like to fire the events when the form is submitted.

Does anyone know if this is possible and how it could be achieved?

Thanks

Was it helpful?

Solution

Execute the Event Tracking method when you’re saving your data in back end. The other option is, execute the event in form submitting point. You can easily do this with Jquery.

Use the link below to get the selected check box value, using jquery

http://api.jquery.com/checked-selector/

once you get the selected value, pass it to the Event Tracking method.

Ex: _gaq.push(['_trackEvent', 'Theme', 'CheckBoxValue','other_Info']);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top