Track event with horizontal scroll in Column Control component
hey! Lets say a visiter wanted to track event with horizontal scroll in Column Control component, which Tracking Event should be used. Can someone help me here.
hey! Lets say a visiter wanted to track event with horizontal scroll in Column Control component, which Tracking Event should be used. Can someone help me here.
To track horizontal scroll events in the Column Control component:
1. Add JavaScript to listen for scroll events:
document.querySelector('.your-column-control').addEventListener('scroll', function() {
if (this.scrollLeft > 0) {
// Trigger tracking event
console.log('Horizontal scroll detected');
}
});2. Trigger tracking using AEM analytics (Adobe or Google Analytics):
- Adobe Analytics: s.tl(this, 'o', 'Horizontal Scroll Event');
- Google Analytics: gtag('event', 'horizontal_scroll', { 'event_category': 'Column Control' });
3. Ensure the JavaScript is included in the AEM component via client libraries or templates.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.