Skip to main content
All CollectionsTracking code
Recording user's keystrokes
Recording user's keystrokes
Kamil avatar
Written by Kamil
Updated over 11 months ago

Regardless of keystroke configuration, LiveSession never records passwords (inputs with type="password") or credit card information (all inputs with autocomplete property starting with cc-)

LiveSession protects end-users' privacy by default, so it doesn’t track what people type into inputs. If you want to enable keystroke tracking, then you have two possible methods to do so:

1. Enable global keystroke tracking

Add keystrokes: true to your tracking code options object - __ls("init", "YOUR_TRACK_ID", { keystrokes: true }). If you use this method, then LiveSession will track every input in your application (excluding passwords and credit cards).

After turning global keystrokes tracking on, you should test this option on your development environment first to ensure that all sensitive data is not exposed to our tracker.

After change, it should look like that:

<!-- LiveSession.io code --> 
<script type="text/javascript">
!function(w, d, t, u) {
if (w.__ls) return;
f = w.__ls = function() {
f.push ? f.push.apply(f, arguments) : f.store.push(arguments)
};
if (!w.__ls) w.__ls = f; f.store = []; f.v = "0.1b";
ls = d.createElement(t);
ls.async = true;
ls.src = u;
s = d.getElementsByTagName(t)[0];
s.parentNode.insertBefore(ls, s);
} (window, document, 'script', ('https:' == window.location.protocol ? 'https://' : 'http://') + 'cdn.livesession.io/track.js');
__ls("init", "YOUR_TRACK_ID", { keystrokes: true }); __ls("newPageView");
</script>
<!-- LiveSession.io code -->

To exclude input from tracking manually, you can add data-ls-disabled property to your HTML inputs.

<input data-ls-disabled type="text" placeholder="Sensitive value"/>

2. Whitelist specific inputs on your website

Another option is to track only specific inputs that are important for you. Add data-ls-enabled to input which value you want to track.

<input data-ls-enabled type="text" placeholder="My unicorn name"/>
Did this answer your question?