Testing Connection
Verify that Bklit tracking is working correctly
Testing Connection
After integrating the Bklit SDK, verify that tracking is working correctly.
Quick Test
1. Visit Your Site
Navigate to your website or application where the SDK is installed.
2. Check Browser Console
Open browser DevTools (F12) and check the Console tab.
With debug mode enabled, you should see:
🎯 Bklit SDK: Initializing with configuration
🆔 Bklit SDK: New session created
🚀 Bklit SDK: Tracking page view...
✅ Bklit SDK: Page view tracked successfully!Without debug mode:
- No logs (normal)
- Check Network tab instead
3. Check Network Tab
In DevTools Network tab:
- Look for requests to
/api/track - Status should be
200 OK - Response should be successful
4. Check Dashboard
Go to your Bklit dashboard:
- Navigate to your project
- Check "Live" or "Sessions" view
- You should see your session/visit
Detailed Testing
Test Page Views
- Navigate to different pages
- Check dashboard for page view events
- Verify page URLs are correct
Test Sessions
- Visit your site
- Wait 30+ minutes
- Visit again
- Check for new session created
Test Custom Events
// Track a custom event
window.trackEvent('button-click', 'click', {
buttonName: 'Sign Up',
location: 'header'
});Check dashboard for the event.
Common Issues
No Events in Dashboard
Possible causes:
- SDK not initialized
- Wrong project ID
- Invalid API token
- Token doesn't have project access
Solutions:
- Verify SDK initialization code
- Check project ID matches dashboard
- Verify API token is correct
- Check token project scoping
Events Delayed
Normal behavior:
- Events may take a few seconds to appear
- Batch processing may cause delays
- Refresh dashboard if needed
Wrong Project Data
Check:
- Project ID in SDK matches dashboard
- Token is scoped to correct project
- Domain restrictions allow your domain
Testing Checklist
- SDK installed correctly
- SDK initialized on page load
- No console errors
- Network requests successful
- Page views appear in dashboard
- Sessions are created
- Custom events work (if used)
Using the Playground
The Bklit playground is a demo app for testing SDK integration:
- Set up playground: Playground Setup
- Configure with your project ID and token
- Test tracking in a controlled environment
Debug Mode
Enable debug mode for detailed logging:
initBklit({
projectId: 'your-project-id',
apiKey: 'your-api-token',
debug: true, // Enable debug mode
});This shows:
- SDK initialization
- Session creation
- Event tracking
- API requests
- Errors and warnings
Production Testing
Before going to production:
- Test in staging environment
- Verify all events track correctly
- Check data appears in dashboard
- Test with real user scenarios
- Monitor for errors
Related Documentation
- SDK Integration - Installing the SDK
- SDK Documentation - Complete SDK guide
- Playground - Testing with playground