« Back to FAQ

How do you log extra information with the Javascript library?

If you attach an email address to your recordings, you’ll be able to search for specific users later. You can identify users by their email address using the following code:

<script type="text/javascript">
window.__squid.push(['identity', {
  email: "[email protected]"
}]);
</script>

In addition to identifying users by email address, you can attach custom data to recordings which will appear in the replay window. Use the same code as above, but specify a data field like so:

<script type="text/javascript">
window.__squid.push(['identity', {
  email: "[email protected]",
  data: {
    id: 1,
    username: "username",
    level: 1,
    first_name: "John",
    last_name: "Snow",
    display_name: "John Snow"
  }
}]);
</script>