krystalview-tracker
v1.0.0
Published
KrystalView — session replay, heatmaps, and behavior analytics for your website
Maintainers
Readme
KrystalView Tracker
Session replay, heatmaps, and behavior analytics for your website.
Installation
Script tag (easiest)
<script src="https://cdn.krystalview.com/kv.js"></script>
<script>
KrystalView.init({
siteKey: "YOUR_SITE_KEY",
secretKey: "YOUR_SECRET_KEY"
});
</script>npm
npm install krystalview-trackerimport { init } from "krystalview-tracker";
init({
siteKey: "YOUR_SITE_KEY",
secretKey: "YOUR_SECRET_KEY",
});WordPress
Install the KrystalView WordPress plugin and enter your site key in Settings → KrystalView.
Shopify
Add the KrystalView app from the Shopify App Store, or paste the script tag into your theme's <head>.
Google Tag Manager
Import the KrystalView tag template and configure your site key.
Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| siteKey | string | required | Your site key from the KrystalView dashboard |
| secretKey | string | required | HMAC signing key for secure data transmission |
| collectorUrl | string | https://collect.krystalview.com | Custom collector endpoint |
| consentRequired | boolean | true | Wait for explicit consent before recording |
| maskAllInputs | boolean | false | Mask all input field values in recordings |
| blockSelector | string | [data-kv-no-record],... | CSS selector for elements to exclude |
| sampleRate | number | 1 | Fraction of sessions to record (0-1) |
Consent Mode
By default, recording waits for explicit consent:
const kv = init({
siteKey: "YOUR_KEY",
secretKey: "YOUR_SECRET",
consentRequired: true, // default
});
// After user accepts cookies/tracking:
kv.enableRecording();
// If user opts out:
kv.disableRecording();To record all sessions without consent (check local privacy laws):
init({
siteKey: "YOUR_KEY",
secretKey: "YOUR_SECRET",
consentRequired: false,
});Excluding Elements
Add data-kv-no-record to any element you don't want recorded:
<div data-kv-no-record>
This content won't appear in session replays
</div>License
MIT
