piwik.js: Tracking middle clicks automatically (they do not fire onclick event)
|Reported by:||matt||Owned by:||vipsoft|
Description (last modified by matt)
There is a regression from the old piwik.js and the new one: middle clicks that open in a new tab in modern browsers, and that are more and more used, are not counted anymore: they do not fire mousedown events.
Here is Anthon's explanation:
Switching from mousedown to click is consistent with how GA, Yahoo, and MS handle the event. If the user releases the button off the element (to abort the operation), no click is generated. Thus, mousedown can result in false outlinks/downloads being reported. I don't recall if right mouse button clicks generated mousedowns on the element, but if it did, there's no way to determine what popup menu operation was selected (open in new window/tab, copy shortcut, save target, etc). If we switched to mouseup, we'd also need a mousedown, to check for the same target element underneath and for double clicks. Striving to capture all clicks is a laudable goal but there are a lot a conditions that make tracking mousedown/mouseup difficult or unreliable. It's already unreliable to a degree. click/mousedown/mouseup all bubble and are cancellable. There's no way for Piwik to set the order that its eventlistener is called (eg first or last). An earlier listener could stop propagating the event. A later listener could cancel the click event so the href isn't followed.
Could we use the event.button as explained on http://www.programmersheaven.com/mb/java-script/304443/304443/right-and-middle-click/?S=B20000
Maybe there is a way of "special handling" the middle click use case and count these clicks?
Change History (12)
comment:2 Changed 5 years ago by matt (mattab)
- Summary changed from piwik.js: Tracking middle clicks automatically (they do not fire mousedown event) to piwik.js: Tracking middle clicks automatically (they do not fire onclick event)
comment:6 Changed 3 years ago by matt (mattab)
- Milestone changed from 4 - Piwik 1.0 - Stable release to Features requests - after Piwik 1.0
comment:7 Changed 3 years ago by vipsoft (robocoder)
- Milestone changed from Feature requests to 1.2 Piwik 1.2
- Type changed from Bug to New feature
comment:10 Changed 3 years ago by vipsoft (robocoder)
- Resolution set to fixed
- Status changed from new to closed