Google Analytics/Tag Manager & DataTables

Google Analytics/Tag Manager & DataTables

ad-sad-s Posts: 1Questions: 1Answers: 0

Hi everyone!
Wondering if anyone out there has had any luck tracking datatables' filter usage in Google Analytics? Specifically, I hope to send usage of the filter function on certain pages as an Event into our analytics using Google Tag Manager. You can generally track form usage, but since DataTables' filtering does not make use of a form element or a submit button I am having difficulty figuring this out!
thanks!

Answers

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916

    It is possible to remove the default search input and create your own search input / submit button and a custom search function using the search(). This might allow you to capture the desired analytics.

    Kevin

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    Another option would be to listen for the search event and record when that happens. You will probably want to ensure that the search value has changed before triggering an analytics event, since it can be triggered with the same search term multiple times (i.e. due to a full redraw of the table).

    Allan

This discussion has been closed.