Google Tag Manager/Analytics inside DataTables
Google Tag Manager/Analytics inside DataTables

Hi everyone!
Has anyone here worked with Google Tag Manager or Google Analytics for tracking interactions inside DataTables?
I’m looking at ways to get more insight into how people actually use the tables — things like which filters they apply most, how often they paginate, and whether certain columns get sorted more than others. I’ve seen examples of sending these events to GA through GTM, but I’m curious if anyone has a method that avoids cluttering the code too much.
I came across this article on customer data analytics that got me thinking about how to structure the data for better reporting: https://stape.io/blog/customer-data-analytics.
Has anyone built something similar or found an efficient way to connect DataTables interactions to a tracking setup?
Replies
Your best bet would be to use
draw
andstate()
. Check if the state you are interested in has changed and if so call the logger.In the case of search, you might want to consider enabling
searchDelay
so you don't get a logged event for every keystroke.Allan