Track if Visitors Copy Your Text in Google Analytics

Track if Visitors Copy Your Text in Google Analytics

People are copying my content, and I think it’s great. I have even done some extra work to make it easier to copy codes/scripts I have published on this blog based on feedback from some visitors. The Remove formatting from Code that you find below is the result of that.

But I have also blog posts that don’t include any scripts. My question was therefore, did visitors find something interesting in those blog posts, and if yes, so interesting that they would copy some of the content?

Since I didn’t find any solution that suited my needs, I did put together my own cut/copy/paste tracking script using jQuery and a script from Motyar that detects selected/highlighted text.

Google Analytics Report for Copied Text

The report in Google Analytics will show you:

  • Category: Clipboard
  • Action: Copy, cut or paste.
  • Label: The text copied/cutted/pasted.
  • Value: How many characters were copied/cutted/pasted.

If you select Pages from the Event report, or Pages as a secondary dimension, you can drill down to the page the text was copied/cutted/pasted from/on. Or even better, create a Custom Report.

Google Analytics report showing which URL the text was copied from Google Analytics report showing which text that was copied

Script for Tracking Text Copied using jQuery

Below is the script for tracking text copied/cutted or pasted using jQuery. If you want to track more (or less) text, change the code in red.

I would also add a “warning” regarding this script. Don’t use it on pages that can contain PII (Personally Identifiable Information), just in case some people copy their own PII info from the page. This type of data is not allowed in Google Analytics.

Some final words

Except from “curiosity” for what visitors are copying, do you see any other valuable areas for this kind of tracking? Protecting your work? SEO? Other content you should write about? Intention of sharing (headline copied)?

If you think the code could be improved, feel free to comment (I’m not a programmer).

jQuery 1.7 or later is needed for this script to work.

3 Comments on "Track if Visitors Copy Your Text in Google Analytics"

  1. is this still works?

    • Yes, it still works. The GA code is old though, it’s for “Classic GA”. If you aren’t using that (hopefully you aren’t), rewrite the code to suit your needs (GA Universal or Google Tag Manager).

  2. Is this tracking configured in Google Tag Manager ?, I need to be instructed more details about this tracking please.

Leave a comment

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.