User tracking
The Support Form Deflector includes user tracking capabilities that help you understand how users interact with the deflection experience. By default, the deflector tracks users anonymously via a first-party cookie, matching the behavior of the Website Widget.
For users in regions governed by privacy regulations like GDPR, you must obtain
explicit consent before tracking user interactions. The deflector does not have a
built-in consent prompt. To comply, you can either disable tracking with
data-user-analytics-cookie-enabled="false" or implement your own consent flow
that conditionally loads the deflector script.
Benefits of user tracking
User tracking provides valuable insights:
- User engagement: Measure how many unique users interact with your integration
- User retention: Analyze how often users return to ask questions
- User journeys: Understand what individual users ask over time
- User profiles: Identify power users and their common questions
Anonymous user tracking
When enabled, Kapa assigns an anonymous unique ID to each user. This ID is
stored in a first-party cookie named kapa_web_id. Since this is a first-party
cookie:
- It's restricted to your domain only
- It's automatically included with requests to your own domain but not sent to any external sites
- It enables consistent user identification across different subdomains of your website
- It helps track user journeys without collecting personally identifiable information
The anonymous ID contains no personally identifiable information but allows the Kapa platform to provide meaningful analytics by:
- Providing aggregate metrics about unique users
- Tracking user retention rates
- Enabling conversation analysis by individual users
Fingerprint tracking
As an alternative to cookie-based tracking, you can enable browser fingerprinting via FingerprintJS Pro. Fingerprint tracking uses browser and device characteristics to create a unique identifier. Because it does not rely on cookies, fingerprint tracking works across domains and can track users for longer under the same identifier.
When both cookie and fingerprint tracking are enabled, fingerprint takes precedence.
Fingerprint tracking is powered by FingerprintJS Pro, which is managed by Kapa.
No additional subscription or platform configuration is required on your end.
Simply set the data-user-analytics-fingerprint-enabled attribute to "true" to
enable it.
User identity from form fields
If your support form includes an email field, you can configure the deflector to
read it at submission time and include it as a structured user identifier with
the query. This removes the need to wire up window.kapaSettings manually.
<script
async
src="https://widget.kapa.ai/kapa-support-form-deflector.bundle.js"
data-integration-id="YOUR_INTEGRATION_ID"
data-user-email-query-selector="#email-input"
...
></script>
The selector can target any <input> element or text-containing element. For
<input> elements, the .value property is read. For other elements,
.textContent is used.
When data-user-email-query-selector is configured, the deflector writes the
form field value to window.kapaSettings.user.email at submission time. This
means the form field takes precedence over any previously set value.
Configuration
| Attribute | Description | Default |
|---|---|---|
data-user-analytics-cookie-enabled | Enables anonymous user tracking via the kapa_web_id cookie (399-day expiry). | "true" |
data-user-analytics-fingerprint-enabled | Enables browser fingerprinting via FingerprintJS Pro. Takes precedence over cookie tracking when both are enabled. | "false" |
data-user-email-query-selector | CSS selector for the email form field. The value is read when the form is submitted. Empty or missing values clear stale data from previous submissions. | Not defined |
When both cookie and fingerprint tracking are disabled, no user identifiers are sent.
Disabling user tracking
To disable anonymous tracking, set data-user-analytics-cookie-enabled to
"false":
<script
...
data-user-analytics-cookie-enabled="false"
></script>
Custom user metadata
In addition to anonymous tracking, you can associate specific user information
with conversations by setting window.kapaSettings:
window.kapaSettings = {
user: {
uniqueClientId: "user-123",
email: "user@example.com",
metadata: {
company_name: "Acme Corp",
first_name: "Jane",
last_name: "Doe",
}
}
};
When collecting custom user metadata like emails or unique IDs, ensure you have appropriate consent mechanisms in place, especially in regions with privacy regulations.
Connecting user identities across platforms
After setting up custom user metadata, you can take advantage of Kapa's ability to maintain consistent user profiles across different touchpoints.
Users in Kapa can have multiple identifiers (anonymous IDs, custom IDs, and email addresses), which creates several advantages:
- Track the same user across documentation, help forums, and other platforms
- Start with anonymous tracking and enrich user profiles as they identify themselves
- Access a user's full interaction history regardless of where they started
Example scenario:
- A new user discovers your documentation and asks a question anonymously (tracked via cookie)
- The same user later logs into your help forum where you've set the
emailattribute - Kapa recognizes the user through their anonymous ID and associates both interactions with a single user profile
- All future interactions, whether anonymous or identified, contribute to the same user profile
This identity resolution helps provide continuity in user support and more accurate analytics.