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

Track file download and outlinks when user does a right click #5287

Closed
mattab opened this Issue Jun 3, 2014 · 14 comments

Comments

Projects
None yet
4 participants
@mattab
Member

mattab commented Jun 3, 2014

Currently the file download automatic link tracker and the Outlink link tracker, do not track clicks from right button. This was reported in forums

Follows up #661, #752

@hpvd

This comment has been minimized.

Show comment
Hide comment
@hpvd

hpvd Jun 3, 2014

in my installation (2.4B3) it

  1. does also not work "out of the box"
    for "normal" left mouse button click (LMBC) on downloads (same window)
    => nothing could be find in visitor log

but it seem to should work without having to do anything?

By default, the Piwik tracking code enables clicks and download tracking.

http://developer.piwik.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking

  1. tracking of LMBC on outgoing links is working fine
    => link with symbol appaers in visitor log
    (tested with links with target="_blank" which opens in new window)

hpvd commented Jun 3, 2014

in my installation (2.4B3) it

  1. does also not work "out of the box"
    for "normal" left mouse button click (LMBC) on downloads (same window)
    => nothing could be find in visitor log

but it seem to should work without having to do anything?

By default, the Piwik tracking code enables clicks and download tracking.

http://developer.piwik.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking

  1. tracking of LMBC on outgoing links is working fine
    => link with symbol appaers in visitor log
    (tested with links with target="_blank" which opens in new window)
@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Jun 5, 2014

Member
  1. yes it definitely should work if your JS code has "enableLinkTracking" in it
Member

mattab commented Jun 5, 2014

  1. yes it definitely should work if your JS code has "enableLinkTracking" in it

@mattab mattab added this to the Future releases milestone Jul 8, 2014

@mattab mattab removed P: normal labels Aug 3, 2014

@mattab mattab modified the milestones: Short term, Long term Sep 19, 2014

@mattab mattab added the Major label Sep 19, 2014

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Dec 1, 2014

Member

If you're a developer and you know how we can track right click, middle clicks on outgoing links, please post a link or info here, thanks.

Member

mattab commented Dec 1, 2014

If you're a developer and you know how we can track right click, middle clicks on outgoing links, please post a link or info here, thanks.

@mattab mattab modified the milestones: Mid term, Short term Dec 1, 2014

@mattab mattab modified the milestones: Short term, Mid term Mar 19, 2015

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Apr 9, 2015

Member

many of us reading this know how important this feature is: it would be a beautiful thing to measure right clicks and ctrl+click, middle clicks, and track those as Outlinks when applicable.

the good news is that there seems to be a possibility to do it. several solutions are discussed in this SO thread.

note: it will be enough to only support this feature modern browsers.

moving to 2.14.0 so we take a stab at this!

Member

mattab commented Apr 9, 2015

many of us reading this know how important this feature is: it would be a beautiful thing to measure right clicks and ctrl+click, middle clicks, and track those as Outlinks when applicable.

the good news is that there seems to be a possibility to do it. several solutions are discussed in this SO thread.

note: it will be enough to only support this feature modern browsers.

moving to 2.14.0 so we take a stab at this!

@mattab mattab modified the milestones: Piwik 2.14.0, Short term Apr 9, 2015

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur May 6, 2015

Member

I don't understand. Tracking the right-click doesn't seem like a big thing but how do we know a user selected "Open in new tab" in the context menu or so?

Member

tsteur commented May 6, 2015

I don't understand. Tracking the right-click doesn't seem like a big thing but how do we know a user selected "Open in new tab" in the context menu or so?

@Globulopolis

This comment has been minimized.

Show comment
Hide comment
@Globulopolis

Globulopolis May 6, 2015

Contributor

@tsteur +1. We can track these clicks as outgoing link only because neither browser doesn't offer any API(or something similar) for this option.

Contributor

Globulopolis commented May 6, 2015

@tsteur +1. We can track these clicks as outgoing link only because neither browser doesn't offer any API(or something similar) for this option.

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab May 6, 2015

Member

Tracking the right-click doesn't seem like a big thing but how do we know a user selected "Open in new tab" in the context menu or so?

Here the idea is to assume that whenever there was a right click, it was followed by user. Since we can't determine whether right click leads to the link being opened, let's just assume it is opened.

Member

mattab commented May 6, 2015

Tracking the right-click doesn't seem like a big thing but how do we know a user selected "Open in new tab" in the context menu or so?

Here the idea is to assume that whenever there was a right click, it was followed by user. Since we can't determine whether right click leads to the link being opened, let's just assume it is opened.

@tsteur tsteur changed the title from track file download and outlinks when user opens URL with Right click (opens new tab) to Track file download and outlinks when user does a right click May 6, 2015

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur May 6, 2015

Member

I'm not sure about that. This would have to be a setting or so since it depends on the website / application. Some might eg define a custom context menu, it might be different for single page applications, etc.

It also depends on the website what users use the right click for. Eg on some sites users might tend to use it for "translate", on some more technical sites people tend to maybe use it for open in new tab, on some sites it is probably barely used since the users are not so advanced, ... Also the behaviour might be different for outlinks and for downloads.

If anything at all I would maybe provide an "opt-in method" for this. If feedback is good one can maybe change it after a few months to "opt-out".

I changed the title to get maybe better awareness of other users what is about to happen here. Feel free to comment feedback...

Member

tsteur commented May 6, 2015

I'm not sure about that. This would have to be a setting or so since it depends on the website / application. Some might eg define a custom context menu, it might be different for single page applications, etc.

It also depends on the website what users use the right click for. Eg on some sites users might tend to use it for "translate", on some more technical sites people tend to maybe use it for open in new tab, on some sites it is probably barely used since the users are not so advanced, ... Also the behaviour might be different for outlinks and for downloads.

If anything at all I would maybe provide an "opt-in method" for this. If feedback is good one can maybe change it after a few months to "opt-out".

I changed the title to get maybe better awareness of other users what is about to happen here. Feel free to comment feedback...

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab May 6, 2015

Member

If anything at all I would maybe provide an "opt-in method" for this. If feedback is good one can maybe change it after a few months to "opt-out".

I still think we could opt-in and provide a opt-out in case it really poses problem for some users. That's because in this issue the scope is only for right clicks on Downloads and Outlinks which will be a very small part of all right clicks. eg. Users who right click to "translate" most of the time will right click anywhere in the window and likely not on a download link or outlink... Can you think of an actual use case where users would right click on outlinks/downloads and not want to open them in most cases?

Member

mattab commented May 6, 2015

If anything at all I would maybe provide an "opt-in method" for this. If feedback is good one can maybe change it after a few months to "opt-out".

I still think we could opt-in and provide a opt-out in case it really poses problem for some users. That's because in this issue the scope is only for right clicks on Downloads and Outlinks which will be a very small part of all right clicks. eg. Users who right click to "translate" most of the time will right click anywhere in the window and likely not on a download link or outlink... Can you think of an actual use case where users would right click on outlinks/downloads and not want to open them in most cases?

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur May 6, 2015

Member

I still think we could opt-in and provide a opt-out in case it really poses problem for some users

Opt-out really poses problems for some users too. I don't understand the problem with first making it opt-in and later opt-out? If you do make an opt-out by default it is basically a breaking change whereas opt-in first is the opposite of deprecating it. We could introduce this new feature, await more feedback etc and later make the switch so nobody will be surprised about a sudden change in behaviour. If you do make opt-out by default you don't give anyone the chance to be aware of this and to react quick enough etc.

For example one might only copy the outlink / download and send it to someone else (I do that sometimes eg to share it with other people etc) (one could still count this as a click in a new tab but not really), I sometimes just copy the text like this, I actually use it sometimes to search for those words and I very often use it for "inspect element" (which is a minority, only developers etc would do that). And I'm sure it often happens by accident or that users right click multiple times on it until they actually open it. In most cases it is probably a "link in new tab" but it always depends.

I wonder how many people actually use context menu + open in new tab as I'm sure most users don't use it at all. I know too many users who do not even use tabs at all (or open in new tab). There are also many advanced (technical) users that might rather use ctrl/cmd + left click or a middle click to open in new tab/window (which can be detected from what I know).

I'm not saying we should not track this at all, but if we do it should be at least opt-in for now.

Member

tsteur commented May 6, 2015

I still think we could opt-in and provide a opt-out in case it really poses problem for some users

Opt-out really poses problems for some users too. I don't understand the problem with first making it opt-in and later opt-out? If you do make an opt-out by default it is basically a breaking change whereas opt-in first is the opposite of deprecating it. We could introduce this new feature, await more feedback etc and later make the switch so nobody will be surprised about a sudden change in behaviour. If you do make opt-out by default you don't give anyone the chance to be aware of this and to react quick enough etc.

For example one might only copy the outlink / download and send it to someone else (I do that sometimes eg to share it with other people etc) (one could still count this as a click in a new tab but not really), I sometimes just copy the text like this, I actually use it sometimes to search for those words and I very often use it for "inspect element" (which is a minority, only developers etc would do that). And I'm sure it often happens by accident or that users right click multiple times on it until they actually open it. In most cases it is probably a "link in new tab" but it always depends.

I wonder how many people actually use context menu + open in new tab as I'm sure most users don't use it at all. I know too many users who do not even use tabs at all (or open in new tab). There are also many advanced (technical) users that might rather use ctrl/cmd + left click or a middle click to open in new tab/window (which can be detected from what I know).

I'm not saying we should not track this at all, but if we do it should be at least opt-in for now.

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab May 12, 2015

Member
Member

mattab commented May 12, 2015

@tsteur tsteur self-assigned this Jun 8, 2015

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur Jun 8, 2015

Member

you are right, there is no problem making it opt-in first and later
opt-out. This is a good solution let's do it 👍

turns out there was always such an opt-in already that can be easily reused. tracker.enableLinkTracking(var enable = true). enable can be set to true to detect middle clicks and to treat them as a "left click". We will reuse this to also treat "right click/open contextmenu" as "left click"

Member

tsteur commented Jun 8, 2015

you are right, there is no problem making it opt-in first and later
opt-out. This is a good solution let's do it 👍

turns out there was always such an opt-in already that can be easily reused. tracker.enableLinkTracking(var enable = true). enable can be set to true to detect middle clicks and to treat them as a "left click". We will reuse this to also treat "right click/open contextmenu" as "left click"

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur Jun 9, 2015

Member

It is within the scope of this issue to track all of right click, middle click and Ctrl+click.

We will track in newer browsers if someone opens the context menu (right click, or ctrl+left click on mac, metaKey+left click on windows, ...), middle click and in some browsers (tested works in latest Chrome + Firefox, does not work in IE10) we also track if someone opens it directly in a new window (ctrl+ left click on windows, metaKey+left click on Mac)

Member

tsteur commented Jun 9, 2015

It is within the scope of this issue to track all of right click, middle click and Ctrl+click.

We will track in newer browsers if someone opens the context menu (right click, or ctrl+left click on mac, metaKey+left click on windows, ...), middle click and in some browsers (tested works in latest Chrome + Firefox, does not work in IE10) we also track if someone opens it directly in a new window (ctrl+ left click on windows, metaKey+left click on Mac)

@diosmosis diosmosis closed this in #8068 Jun 16, 2015

diosmosis added a commit that referenced this issue Jun 16, 2015

Merge pull request #8068 from piwik/5287
Fixes #5287, track optionally downloads and outlinks for middle clicks, opening context menus and ctrl/command clicks.

mattab pushed a commit to matomo-org/developer-documentation that referenced this issue Jun 26, 2015

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Jun 26, 2015

Member

fyi: updated JS client doc in matomo-org/developer-documentation@84934d7

Member

mattab commented Jun 26, 2015

fyi: updated JS client doc in matomo-org/developer-documentation@84934d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment