3 ms·
True, you could dedicate CSS classes like that. I’m really talking about separation of concerns: CSS is for styling, not communicating user intentions to extern
by vosper 7y ago
True, you could dedicate CSS classes like that. I’m really talking about separation of concerns: CSS is for styling, not communicating user intentions to external systems. A data attribute is better, and you could program the selector-creator to prefer those attributes if it can find them.
That doesn’t help with after-the-fact attribution, though. That’s where using existing CSS classes really shines. With the huge proviso that you have to be sure the CSS selector you’re using really captures (and only captures) the action you’re trying to track. I suspect it’s easy to get this wrong and end up with skewed analytics.