Skip to main content
Analytics collection is an optional feature that captures user interface interactions and behavioral patterns within your app. This additional data layer helps Kount detect sophisticated fraud attacks that rely on automated bots or unusual user behavior.
Analytics collection was introduced in version 4.1.0 and is enabled by default. You can disable it at any time if it doesn’t fit your use case.

What is Analytics Collection?

While standard data collection gathers device information (hardware, software, network), analytics collection focuses on how users interact with your app:
  • Screen transitions and navigation patterns
  • UI element interactions (taps, swipes, form fills)
  • Timing metrics (time spent on screens)
  • User behavior patterns
Analytics data is anonymous and doesn’t capture specific content like text you type, images you view, or sensitive information. It only captures interaction patterns.

Why Use Analytics?

Analytics collection helps detect fraud patterns that device data alone might miss:

Bot Detection

Automated bots interact with apps differently than humans. Analytics can identify unnatural click patterns, superhuman speeds, and scripted behaviors.

Account Takeover Prevention

Legitimate users have consistent behavioral patterns. Sudden changes in navigation or interaction style may indicate account compromise.

Fraud Ring Identification

Fraudsters often use similar attack patterns. Analytics helps identify groups of users exhibiting identical behaviors.

Enhanced Risk Scoring

Combining device data with behavioral data provides more accurate risk assessments, reducing false positives and false negatives.

What Data is Collected?

Analytics collection captures UI interactions without recording specific content:

Activity Lifecycle Events

// These events are automatically tracked:
- Activity created
- Activity started
- Activity resumed
- Activity paused
- Activity stopped
- Activity destroyed
This helps Kount understand:
  • How long users spend on each screen
  • Navigation patterns through your app
  • Whether behaviors match typical user flows

UI Interaction Patterns

Starting with version 4.1.0, the SDK tracks:
  • View interactions: Buttons clicked, switches toggled, etc.
  • Scroll behavior: Scrolling speed and patterns
  • Form interactions: Fields focused (but not content typed)
  • Gesture patterns: Tap, swipe, and pinch behaviors
What is NOT collected:
  • Text entered in forms
  • Images or media viewed
  • Specific content displayed
  • Passwords or sensitive data
  • Anything behind authentication

Enabling and Disabling Analytics

Analytics collection is controlled with a single method:

Enable Analytics (Default)

import com.kount.api.KountSDK

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        KountSDK.setMerchantId("999999")
        KountSDK.setEnvironment(KountSDK.ENVIRONMENT_TEST)
        
        // Enable analytics collection
        KountSDK.setCollectAnalytics(true)
    }
}

Disable Analytics

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        KountSDK.setMerchantId("999999")
        KountSDK.setEnvironment(KountSDK.ENVIRONMENT_TEST)
        
        // Disable analytics collection
        KountSDK.setCollectAnalytics(false)
    }
}
Configuration tip: Set analytics preference before calling collectForSession() for the first time. Changes take effect immediately, but won’t affect already-started collection.

Java Example

import com.kount.api.KountSDK;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        KountSDK.INSTANCE.setMerchantId("999999");
        KountSDK.INSTANCE.setEnvironment(KountSDK.ENVIRONMENT_TEST);
        
        // Enable or disable analytics
        KountSDK.INSTANCE.setCollectAnalytics(true);
    }
}

Performance Considerations

Analytics collection is designed to have minimal impact on your app:
Impact: NegligibleAnalytics collection uses minimal memory to track events. The SDK buffers events efficiently and flushes them periodically.
Version 4.2.4 fixed a memory leak that could occur with analytics disabled in apps with many Activities. Always use the latest SDK version.
Impact: Very LowEvent tracking happens on background threads and doesn’t block the main UI thread. Users won’t notice any performance degradation.
Impact: MinimalThe SDK is optimized to minimize battery drain. Analytics collection adds less than 1% to overall battery consumption in typical use.
Impact: LowAnalytics data is transmitted along with device data during collectForSession(). The additional payload is typically less than 10KB.

Single Page Applications (SPAs)

If your app uses a single Activity with fragments or a single-page architecture:
Important: Version 4.1.3 fixed an issue where analytics data transmission was delayed in apps that don’t transition to a second Activity. If you’re building an SPA, ensure you’re using version 4.1.3 or later.
class SingleActivityApp : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Configure SDK
        KountSDK.setMerchantId("999999")
        KountSDK.setCollectAnalytics(true)
        
        // For SPAs, call collectForSession when ready
        // Don't wait for Activity transition
        KountSDK.collectForSession(
            this,
            { sessionId ->
                Log.d("Kount", "SPA collection completed: $sessionId")
            },
            { sessionId, error ->
                Log.e("Kount", "SPA collection failed: $error")
            }
        )
    }
}

When to Use Analytics

Decide whether to enable analytics based on your use case:

Enable Analytics If:

High-risk transactions
Your app processes financial transactions, in-app purchases, or other high-value operations.
Account creation
You want to detect fake accounts and bot registrations.
Targeted by fraud
You’ve experienced fraud attacks or bot activity in the past.
Enhanced accuracy needed
You need the most accurate fraud detection possible and want to reduce false positives.

Consider Disabling If:

Privacy-sensitive users
Your user base is particularly privacy-conscious, though analytics doesn’t collect PII.
Very simple flows
Your app has a minimal UI with few interactions (behavioral data may not add value).
Performance-critical
You’re building a game or performance-sensitive app where every millisecond matters (though impact is minimal).
Regulatory restrictions
Your industry has specific regulations that limit behavioral tracking (consult your legal team).

Combining with Data Collection

Analytics works alongside standard data collection:
class CheckoutActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        // Configure ONCE in your app (typically in Application class)
        KountSDK.setMerchantId("999999")
        KountSDK.setEnvironment(KountSDK.ENVIRONMENT_PRODUCTION)
        KountSDK.setCollectAnalytics(true)  // Enable analytics
        
        // Collect BOTH device data AND analytics
        KountSDK.collectForSession(
            this,
            { sessionId ->
                // This sessionId represents:
                // 1. Device fingerprint data
                // 2. Behavioral analytics data
                submitOrder(sessionId)
            },
            { sessionId, error ->
                handleCollectionError(error)
            }
        )
    }
}
You don’t need to call separate methods for analytics. When enabled, analytics data is automatically included in your collectForSession() call.

Version History

Analytics collection has evolved across SDK versions:
VersionEnhancement
4.1.0Initial release of UI element collection capabilities
4.1.2Added collection of additional data points
4.1.3Fixed transmission delay in Single Page Applications
4.2.2Fixed race condition in collection completion handlers
4.2.3Fixed gradle implementation for proper library installation
4.2.4Fixed memory leak when analytics disabled in apps with many Activities
4.3.0Added completion handler feature for post-collection actions
Always use the latest SDK version to benefit from bug fixes and performance improvements. See the Changelog for complete version history.

Privacy and Compliance

Analytics collection is designed with privacy in mind:

No PII Collected

Analytics tracks interaction patterns, not personal data. No names, emails, phone numbers, or account details are captured.

No Content Recording

The SDK doesn’t capture what you type, what you see, or what’s displayed on screen. Only interaction types are recorded.

GDPR Compliant

Behavioral patterns qualify as non-PII technical data. However, if required by your privacy policy, you can disable analytics.

User Control

You control whether analytics is enabled. Users don’t need to grant additional permissions for analytics collection.

Disclosure Requirements

While analytics data is anonymous, you may want to disclose its use in your privacy policy:
Sample privacy disclosure:“We use Kount’s fraud detection service to protect your account. Kount collects device information and interaction patterns (but not personal data or content) to identify fraudulent activity.”
Consult your legal team for specific privacy policy requirements in your jurisdiction.

Troubleshooting

Symptom: Data not transmitted in single-Activity apps.Solution: Upgrade to version 4.1.3 or later, which fixes transmission delays in SPAs.
// Ensure you're calling collectForSession explicitly
KountSDK.collectForSession(this, successCallback, failureCallback)
Symptom: Memory usage grows over time in apps with many Activities.Solution: Upgrade to version 4.2.4 or later, which fixes the memory leak.
Symptom: Success callback fires before data transmission finishes.Solution: Upgrade to version 4.2.2 or later, which fixes a race condition in completion handlers.

Next Steps

Data Collection

Learn about device data collection fundamentals

Configuration Guide

Complete SDK configuration reference

Environments

Learn about Test vs Production environments

API Reference

Explore the complete SDK API

Build docs developers (and LLMs) love