Tracking Cut, Copy and Pasting of Text on Website within Adobe Analytics

Capturing what users copy and paste within your site, leveraging Adobe Analytics, could help you better optimize the journey + flow accordingly.  This post will explain what you need to do to make that happen for your individual website.

Below is the necessary code you will need to put in place.  This assumes you have one eVar and one event open within your Adobe Analytics Reporting suite of choice to capture the values in question.  This also assumes you have the jQuery library loaded on your site.  If you do not, please add that prior to adding this logic:

// This script for tracking cut/copy/paste in Adobe Analytics
function getSelectionSelected() {
if(window.getSelection) {return window.getSelection();}
else if(document.getSelection) {return document.getSelection();}
else {
var selection = document.selection && document.selection.createRange();
if(selection.text) { return selection.text; }
return false;
return false;

$(document).ready(function() {
$(‘body’).on(‘copy cut paste’, function(ccp) { // Tracking cut, copy or paste with jQuery.
var selection = getSelectionSelected();
var maxLength = 255; // Up to the maximum length of characters for an eVar be tracked. Change this number if you want to track less text (as a prop).
if(selection && (selection = new String(selection).replace(/^\s+|\s+$/g,”))) {
var textLength = selection.length;

s.linkTrackVars = “eVar100,events”;
s.linkTrackEvents = “event120”; = (typeof !== “undefined” &&“event120″)===-1)?(”,event120″):”event120″;
s.eVar100 = ccp.type+”:”+selection+”:”+textLength;,”o”,ccp.type);


That’s it.  With this in place you will be tracking these events within Adobe Analytics and being able to optimize off it said data.