snowplow / snowplow-javascript-tracker

Snowplow event tracker for client-side and server-side JavaScript. Add analytics to your websites, web apps and servers.
http://snowplowanalytics.com
BSD 3-Clause "New" or "Revised" License
547 stars 220 forks source link

Add text-selection tracking #582

Open chuwy opened 7 years ago

chuwy commented 7 years ago

For text-heavy websites, like blogs or newspapers we can add text-selection tracking, which triggers event whenever user highlighted some part of paragraph (important part probably). This allows our users to implement medium-like "top-highlight" feature.

I see API something like:

snowplow_name_here('enableHighlightTracking', '.content.article') // .content.article is DOM selector

Which sends to collector event with startSymbol: number and endSymbol: number (maybe also contentHash: string so analysts can be sure they're comparing same blocks of text). These startSymbol and endSymbol can later be joined with content of text block.

alexanderdean commented 7 years ago

I LOVE this idea!

kingo55 commented 7 years ago

We used to track cut/copy text on websites and we'd see a lot of users copying phone numbers and addresses.

Found it eye opening - you'd be surprised how many of those events take place. You may need to consider whether or not you want to track content highlighted inside forms. We had to explicitly avoid tracking copy/paste from forms (e.g. email validation, badly implemented placeholder text ;).

Highlight would be interesting. Probably much higher volume?

On Sun, 7 May 2017 at 06:09 Alexander Dean notifications@github.com wrote:

I LOVE this idea!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/snowplow/snowplow-javascript-tracker/issues/582#issuecomment-299663108, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQILLy4gJhCbx7mA7gyQqIwxa-bxTLUks5r3NOCgaJpZM4NS5Bf .

chuwy commented 7 years ago

I think copy-tracking nicely fits this feature, so we can add copied: boolean property to event.

Regarding form-tracking - I guess that would be solved by a dom-selector argument, so one can decide explicitly what blocks of website can be tracked and just not enable it for forms.