Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchstart event logging non-existent clicks #65

Closed
alexhass opened this issue Apr 30, 2016 · 3 comments
Closed

Touchstart event logging non-existent clicks #65

alexhass opened this issue Apr 30, 2016 · 3 comments

Comments

@alexhass
Copy link

I have reviewed your code because of https://www.drupal.org/node/2671716 and like to ask how you would solve Touchstart event logging non-existent clicks.

I have a document listener bound to "mousedown keyup touchstart" as you can see in http://cgit.drupalcode.org/google_analytics/tree/js/google_analytics.js to overcome the other serious bugs autotrack currently has like:

Monitoring the mouse movement looks also a problem as I found on the net. Any other ideas?

@philipwalton
Copy link
Member

There's always going to be a trade off here because there's no 100% reliable way to know for sure when a user action initiates a browser navigation.

If you bind to only the click event (as autotrack does) you'll miss some links, but if you bind to touchstart, mousedown, and keyup, you get a lot of false positives. It's a trade off.

That being said, I'm open to giving users the option to set that dial wherever they want. For example, we could add a configuration option to listen for additional event types and then indicate those event types in the event hits so users could distinguish between them when reporting on outbound link tracking.

Would that appeal to the Drupal team? It would mean your reports might looks something like this:

Event Category Event Action Event Label Total Events
Outbound Link click http://example.com 112
Outbound Link mousedown http://example.com 61
Outbound Link touchstart http://example.com 38
Outbound Link contextmenu http://example.com 14

Also, FWIW, in a comment on that page someone says:

Google has documented in past that Google use mousedown keyup touchstart events to trigger tracking on cross domain auto link tracking. This was just overtaken.

This recommendation (which was removed from the documentation because it was too often misinterpreted) was for adding a linker param in cross domain tracking, which is a different thing entirely. In the case of adding a linker param, false positives have no negative impact. But in the case of outbound link tracking, false positives lead to inaccurate results, so the same methodologies shouldn't be naively applied to both use cases.

@philipwalton
Copy link
Member

The suggestion I proposed in #65 (comment) has been implemented in the 1.0 release.

@alexhass
Copy link
Author

alexhass commented Sep 17, 2016

I tend to say you know it better. I used click only in past and many complained that no mobile users have been tracked. It looked like click does not fire on mobile. How can we implement this in a safe way so it works all times on all devices without false detections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants