Open Jogai opened 4 years ago
What I want is to send only one event per range. So if I divide my page in quarters I send an event for 25, 50, 75 and 100%.
A user that scrolls to 33%, then to 44%, then back to 36% would once send an event with 25 as eventLabel.
Sorry I was rubber ducking, I think this should work:
ga('require', 'maxScrollTracker', { increaseThreshold: 25, hitFilter: function(model) { var scrollPercentage = model.get('eventLabel'); // round to 25's model.set('eventLabel', 25 * Math.round(scrollPercentage / 25), true); } });
What I want is to send only one event per range. So if I divide my page in quarters I send an event for 25, 50, 75 and 100%.
A user that scrolls to 33%, then to 44%, then back to 36% would once send an event with 25 as eventLabel.
Sorry I was rubber ducking, I think this should work: