[Plugin: WP SlimStat] Tracking right click of download links
-
Hello again Camu,
I thought I would start a new thread on this topic to better facilitate separation of it from the open in new window thread.
Here is what I have discovered when trying to track right clicks of file downloads in SlimStat. Currently my downloads are set NOT to open in a new window due to the problems associated with that.
Using this code, left click is tracked as “2” and right click is tracked as “3” in event files.
<a href="/files/download.pdf" onclick="ss_te(event,2)" onmousedown="if((event.which == 3) || (event.button==2)){ss_te(event,3,false);}">Download file</a>
This works fine except for when the right click is tracked, the file path is NOT tracked, only the page that the link was on.
Example of what appears in “Recent Events” on the Content page when the file link is right-clicked:
/page_with_link/
Example of what appears in “Recent Events” on the Content page when the file link is left-clicked:
/files/download.pdf
Rather than assigning each link a different number and creating a file (cheat sheet) to match link numbers with the associated files that were downloaded, I am wondered if you had any thoughts on why the link path was not getting logged using the right-click option?
Important to note that the above “right-click” tracking code does not function properly when using “onmouseup” or “oncontextmenu”, only “onmousedown” works almost right except for not tracking the full file path.
Also note the resulting outcomes to the tests using these variations.
1. When replacingss_te(event,3,false)
withss_te(event,3,true)
on right-click the file automatically starts to download before an option is chosen from the right-click menu and the auto download is tracked but not any resulting choice from the right-click menu.
2. When replacingss_te(event,3,false)
withss_te(event,3)
on right-click the file DOES NOT automatically start to download before a option is chosen from the right-click menu, which is good, but the download is NOT tracked either.Hoping you have some ideas on this topic.
Regards,
SDesign
- The topic ‘[Plugin: WP SlimStat] Tracking right click of download links’ is closed to new replies.