Drupal: detect elements in viewport + statistics

50 Views Asked by At

Motivation: detect elements (view's divs) in viewport on scroll + ignore iterations + collect to DB + show statistics. Is there any solutions? Or just give me directions. I'll be very grateful. No results with my searches, no ideas (Google Analytics - NA).

1

There are 1 best solutions below

2
On

If I understand you correctly you can use Google Tag Managers "Element Visibility" trigger.

This lets you fire off an event when a certain percentage of an element is within a users view. It also has options such as "firing once per page" or "per element".

You can then use Google Analytics to show statistics on these events.

I found this article which covers the feature.