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.

4 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.

  3. Milos Milosavljevic | December 10, 2019 at 3:45 pm | Reply

    There is a lot of use in being able to track this.
    The Label will tell you precisely which segments of your article have engaged the reader, or which data is of value to them.
    If it’s a logged in user, you can also profile your subscriber better and fine tune direct communications, and it is definitely useful for creating fine tuned audiences for display ads or retargeting in search and display, as well as for content recommendations based precisely on what an audience found valuable in the article.

    An interesting variation would be to use the Category field article as Clipboard, the Action field to collate category names and tag names as comma separated values and the Label field for the copied text. From a business angle, I am not really interested if the cut or paste it.
    The Action field would then be very useful, as we could create Google Segments and Audiences based on tag combinations (i.e. import audiences into Google Ads: Everyone who copied text from articles belonging to Personal Finance category, or Work Permit category.
    Or, everyone who copied text with the Running Shoe Model X in the copied text.

Leave a comment

Your email address will not be published.


*


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