Web SDK
The Inhouse Web SDK allows you to track user interactions, events, and performance metrics in your web applications. It provides comprehensive analytics and deep linking capabilities for modern web experiences.Installation
NPM Package
Install the SDK using npm:CDN
Include the SDK directly from CDN:ES6 Modules
Import the SDK in your ES6 modules:Quick Start
Basic Setup
Initialize the SDK with your project configuration:Configuration Options
Event Tracking
Basic Events
Track user interactions and page views:Custom Events
Track business-specific events:Event Properties
Add context to your events:User Identification
Setting User Properties
Identify and track users across sessions:User Segmentation
Group users by properties for targeted analytics:Deep Linking
Web-to-App Navigation
Enable seamless navigation between web and mobile apps:Deep Link Configuration
Configure deep linking behavior:Performance Tracking
Core Web Vitals
Track performance metrics automatically:Custom Performance Metrics
Track application-specific performance:Session Management
Session Tracking
Monitor user sessions and engagement:Session Properties
Error Tracking
Automatic Error Tracking
Track JavaScript errors automatically:Custom Error Tracking
Track application-specific errors:Privacy and Compliance
GDPR Compliance
Handle user consent and data privacy:Data Anonymization
Advanced Features
Event Batching
Optimize performance with event batching:Custom Transport
Use custom transport for events:Plugin System
Extend functionality with plugins:Testing and Debugging
Debug Mode
Enable debug logging:Testing Tools
Integration Examples
React Integration
Vue.js Integration
Vanilla JavaScript
Best Practices
Event Naming
- Use Consistent Naming: Follow a consistent naming convention
- Be Descriptive: Use clear, descriptive event names
- Use Snake Case: Use snake_case for event names
- Group Related Events: Use prefixes for related events
Property Management
- Standardize Properties: Use consistent property names across events
- Validate Data: Ensure property values are valid and consistent
- Limit Property Count: Keep properties focused and relevant
- Document Properties: Document your event schema
Performance Optimization
- Batch Events: Use event batching for high-frequency events
- Debounce Tracking: Debounce rapid-fire events
- Lazy Loading: Load SDK only when needed
- Minimize Payload: Keep event payloads small
Privacy and Security
- User Consent: Always respect user privacy preferences
- Data Minimization: Only collect necessary data
- Secure Transmission: Use HTTPS for all data transmission
- Regular Audits: Regularly review data collection practices
Troubleshooting
Common Issues
Events Not Sending
Events Not Sending
- Check API key and project ID
- Verify network connectivity
- Check browser console for errors
- Verify SDK initialization
Missing Data
Missing Data
- Verify event tracking calls
- Check property values
- Review event naming
- Test in debug mode
Performance Issues
Performance Issues
- Enable event batching
- Reduce event frequency
- Check for memory leaks
- Monitor network requests
Debug Commands
Next Steps
Mobile SDKs
Integrate with React Native apps.
API Reference
Use the REST API for advanced integration.
Deep Linking
Set up deep linking for web-to-app navigation.
Analytics
Understand your analytics data.
Need help with the Web SDK? Check our API documentation or contact [email protected].