You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to know how often users print, copy, paste on a page.
Print and paste information would only work for desktop keyboard commands (not mobile or when a menu has been used), even so some indication would still be helpful.
functiongetSelected(){if(window.getSelection){returnwindow.getSelection();}elseif(document.getSelection){returndocument.getSelection();}else{varselection=document.selection&&document.selection.createRange();if(selection.text){returnselection.text;}returnfalse;}returnfalse;}$(document).ready(function(){$('body').on('copy cut paste',function(ccp){// Track cut, copy or paste with jQuery.varselection=getSelected();varmaxLength=150;// Up to 150 Characters from your text will be tracked. Change this number if you want to track more or less text.if(selection&&(selection=newString(selection).replace(/^\s+|\s+$/g,''))){vartextLength=selection.length;// How many characters was copied/cutted/pasted.if(selection.length>maxLength){selection=selection.substr(0,maxLength)+"..."}// If the text is longer than maxLength, add ... to the end of the textelse{selection=selection;// If the text is shorter than maxLength, just track the text as it is.}_gaq.push(['_trackEvent','Clipboard',ccp.type,selection,textLength]);// Track copied/cutted/pasted data in Google Analytics as Events}});});
The text was updated successfully, but these errors were encountered:
It would be useful to know how often users print, copy, paste on a page.
Print and paste information would only work for desktop keyboard commands (not mobile or when a menu has been used), even so some indication would still be helpful.
Via https://stackoverflow.com/questions/2903991/how-to-detect-ctrlv-ctrlc-using-javascript/2904944#2904944
and/or
For copy we can get a broader idea by tracking text selection:
Via https://www.savio.no/analytics/track-if-visitors-copy-your-text-in-google-analytics
The text was updated successfully, but these errors were encountered: