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:

  1. Navigate to your project
  2. Check "Live" or "Sessions" view
  3. You should see your session/visit

Detailed Testing

Test Page Views

  1. Navigate to different pages
  2. Check dashboard for page view events
  3. Verify page URLs are correct

Test Sessions

  1. Visit your site
  2. Wait 30+ minutes
  3. Visit again
  4. 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:

  1. Verify SDK initialization code
  2. Check project ID matches dashboard
  3. Verify API token is correct
  4. 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:

  1. Set up playground: Playground Setup
  2. Configure with your project ID and token
  3. 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:

  1. Test in staging environment
  2. Verify all events track correctly
  3. Check data appears in dashboard
  4. Test with real user scenarios
  5. Monitor for errors

On this page