I have a product list filter, I want to track event when someone clicks on different 'view type': list/grid/table, screenshot below:
I was able to track click events using Classes and ID's, but these view elements doesnt have any classes or id, instead it has attribute as "data-type", screenshot below:
Can someone explain how can I track event when someone clicks on any of these 3 different view types.
You can use the Click Trigger
with condition Click Element
So to target the first <a>
element you can use the
CSS Selector : a[data-type='list']
So the other 2 are quite the same
a[data-type='grid']
a[data-type='table']
Or you want to more precisely by narrow the down the range
div.change-result-view a[data-type='list']
This mean you only want the a element with data-type is list
under the div.change-result-view