Google Analytics/Tag Manager & DataTables
Google Analytics/Tag Manager & DataTables
ad-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!
This discussion has been closed.
Answers
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
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