Data Collection, Inspiration

Event Tracking for Mouseover/Hover on Element for X Seconds

A client of mine recently asked me to track ‘mouse interaction’ with an iframe that they embed on several pages. By ‘mouse interaction’, the client basically meant that they would like to track whenever users hovered their mouse cursor over the iframe for a certain amount of time. I’ve previously posted that you can track any mouse or keyboard interactions with Google Analytics. As long as they occur within the browser.

Luckily, there’s a widely supported browser event called ‘mouseover‘. The mouseover event fires when a user moves the mouse cursor over a specified element – for instance, an iframe. But it can be used on any visible HTML element on the page. So, by combining this event with a timer, it’s possible to push a dataLayer event to Google Tag Manager. And then use that event to send an event hit Google Analytics.

In the end, we’ll end up tracking Google Analytics events whenever a user hovers his or hers mouse over our specified element. Continue reading

Data Quality

How to track if Google Analytics is blocked – in Analytics!

Ad blockers have been around for years – and I won’t go into a moral or ethical discussion about the use of them. But with Apple’s iOS9 update, content (or ad) blocking suddenly became much more mainstream. Now,¬†the problem is that many ad blockers also block Google Analytics.

Analytics software such as Google Analytics is there to help users Рnot monitor or track them per se. We use analytics data to improve and optimize our websites. When our analytics software is blocked, we risk making bad or outright wrong decisions. So one important thing to do as an analyst in this landscape of blocking, is to get an idea of how big the problem actually is. And why not use Google Analytics to track how many users are blocking Google Analytics? Continue reading