Overview
This guide helps you diagnose and fix common Woopra tracking issues. Use the debugging tools and techniques below to ensure your tracking is working correctly.
Debug Mode
Enable Debug Mode
Enable debug mode to see detailed tracking information in your browser console:
woopra.config({ debug: true });
This will log all tracking calls, configuration changes, and API responses to the console.
What Debug Mode Shows
woopra.config({ debug: true });
woopra.identify({ email: 'test@example.com' });
woopra.track('button_click', { button: 'signup' });
// Console output:
// [Woopra] Identify: {email: "test@example.com"}
// [Woopra] Track: button_click {button: "signup"}
// [Woopra] Request sent to: https://www.woopra.com/track/...
Common Issues
No Data Appearing in Dashboard
Symptoms: Tracking code is installed but no data shows in Woopra dashboard.
Solutions:
- Verify tracking code is installed:
// Open browser console and check
if (typeof woopra !== 'undefined') {
console.log('Woopra loaded successfully');
console.log('Config:', woopra.config());
} else {
console.error('Woopra not loaded - check installation');
}
- Check domain configuration:
// Verify domain matches your Woopra project
console.log(woopra.config().domain);
// Should match your project domain
// If incorrect, update:
woopra.config({ domain: 'yourdomain.com' });
- Test with debug mode:
woopra.config({ debug: true });
woopra.track('test_event');
// Check console for errors
Verify network requests:
Check for ad blockers:
- Disable browser extensions
- Test in incognito/private mode
- Ad blockers often block analytics scripts
Events Not Tracking
Symptoms: Some events aren't showing up in Woopra.
Solutions:
- Check event name syntax:
// Good - simple, descriptive names
woopra.track('button_click');
woopra.track('form_submitted');
// Avoid - special characters, spaces
woopra.track('button click!'); // Don't use spaces or special chars
woopra.track('form/submitted'); // Avoid slashes
- Verify woopra.track() called after config:
// Correct order:
woopra.config({ domain: 'yourdomain.com' });
woopra.identify({ email: 'user@example.com' });
woopra.track('event_name');
// Wrong - tracking before config:
woopra.track('event_name'); // May not work
woopra.config({ domain: 'yourdomain.com' });
- Look for console errors:
// Check if woopra exists before tracking
if (typeof woopra !== 'undefined') {
woopra.track('event_name');
} else {
console.error('Woopra not loaded');
}
- Verify property types:
// Good - valid JSON types
woopra.track('purchase', {
amount: 99.99, // Number
product: 'Pro Plan', // String
success: true // Boolean
});
// Avoid - invalid types
woopra.track('purchase', {
callback: function() {}, // Functions not supported
element: document.body // DOM elements not supported
});
User Identification Not Working
Symptoms: Users aren't being identified or properties aren't showing.
Solutions:
- Ensure identify() called with valid data:
// Good - valid email and properties
woopra.identify({
email: 'user@example.com',
name: 'John Doe',
id: 'user_12345'
});
// Bad - missing required identifier
woopra.identify({
name: 'John Doe' // No email or id
});
- Call identify() before track():
// Correct order:
woopra.identify({ email: 'user@example.com' });
woopra.track('page_view');
// Less effective:
woopra.track('page_view');
woopra.identify({ email: 'user@example.com' });
- Force update with push():
woopra.identify({ email: 'user@example.com' })
.push(); // Force send immediately
Cross-Domain Tracking Issues
Symptoms: Sessions not merging across domains.
Solutions:
- Use consistent identifiers:
// On all domains, use same identifier
woopra.identify({
email: 'user@example.com', // Same on all domains
id: 'user_12345' // Same on all domains
});
- Configure cookie domain correctly:
// For subdomains (www.example.com, app.example.com)
woopra.config({
cookie_domain: '.example.com' // Note the leading dot
});
// For separate domains, just use consistent identification
- Verify cookies are set:
// Check browser console → Application → Cookies
// Look for 'woopra' cookie
// Should be present on all domains
Real-Time Data Delay
Symptoms: Events appear in dashboard with delay.
Solutions:
Understand normal delays:
- Real-time dashboard: Usually instant to 30 seconds
- Reports: May take 1-2 minutes to update
- Some aggregated reports: Update every 5-15 minutes
Force immediate send:
woopra.track('critical_event', { data: 'value' });
woopra.push(); // Force send immediately
- Check ping settings:
woopra.config({
ping: true, // Enable ping
ping_interval: 12000 // Send ping every 12 seconds
});
Debugging Techniques
Check Tracking Status
// Comprehensive tracking check
function checkWoopraStatus() {
if (typeof woopra === 'undefined') {
console.error('Woopra not loaded');
return;
}
console.log('✓ Woopra loaded');
const config = woopra.config();
console.log('Domain:', config.domain);
console.log('Cookie domain:', config.cookie_domain);
console.log('Debug mode:', config.debug);
// Test tracking
woopra.track('debug_test', { timestamp: Date.now() });
console.log('✓ Test event sent');
}
checkWoopraStatus();
Verify Network Requests
Monitor Woopra API calls:
// Enable debug mode
woopra.config({ debug: true });
// Track event
woopra.track('test_event', { test: true });
// Check DevTools → Network tab
// Filter by 'woopra' or 'track'
// Verify:
// - Request URL contains your domain
// - Status is 200
// - Request payload includes your event data
Test User Identification
// Test user identification
function testUserIdentification() {
const testUser = {
email: 'test@example.com',
name: 'Test User',
id: 'test_123'
};
console.log('Identifying user:', testUser);
woopra.identify(testUser);
// Track an event to trigger send
woopra.track('identification_test');
console.log('Check Woopra dashboard for user:', testUser.email);
}
testUserIdentification();
Monitor Page Views
// Track page views with debug info
function trackPageView() {
const pageData = {
url: window.location.href,
path: window.location.pathname,
title: document.title,
referrer: document.referrer
};
console.log('Page view:', pageData);
woopra.track('pv', pageData);
}
trackPageView();
Browser-Specific Issues
Safari ITP (Intelligent Tracking Prevention)
Safari's ITP may limit cookie lifetime:
// Use first-party cookie domain
woopra.config({
cookie_domain: window.location.hostname,
cookie_path: '/'
});
// Consider server-side tracking for critical events
Firefox Enhanced Tracking Protection
// Ensure tracking is allowed
woopra.config({
cookie_domain: window.location.hostname
});
// Test in private browsing mode
Ad Blockers
// Detect if Woopra is blocked
setTimeout(function() {
if (typeof woopra === 'undefined') {
console.warn('Woopra blocked - likely by ad blocker');
// Fallback: Send critical events to your server
sendToYourServer({
event: 'woopra_blocked',
url: window.location.href
});
}
}, 1000);
Performance Issues
Script Loading Slow
<!-- Use async loading -->
<script async src="//static.woopra.com/js/w.js"></script>
<!-- Or defer -->
<script defer src="//static.woopra.com/js/w.js"></script>
Too Many Events
// Throttle high-frequency events
let scrollTimeout;
window.addEventListener('scroll', function() {
clearTimeout(scrollTimeout);
scrollTimeout = setTimeout(function() {
woopra.track('scroll', {
depth: window.scrollY
});
}, 1000); // Only track once per second
});
Data Quality Issues
Duplicate Events
// Prevent duplicate event tracking
let eventTracked = false;
function trackOnce(eventName, properties) {
if (!eventTracked) {
woopra.track(eventName, properties);
eventTracked = true;
}
}
// Use for important events
trackOnce('purchase', { amount: 99.99 });
Missing Properties
// Validate properties before tracking
function trackWithValidation(eventName, properties) {
// Check required properties
if (!properties.userId) {
console.error('Missing userId in event:', eventName);
return;
}
woopra.track(eventName, properties);
}
trackWithValidation('purchase', {
userId: 'user_123',
amount: 99.99
});
Getting Help
Check Woopra Status
Visit status.woopra.com to check for service interruptions.
Enable Verbose Logging
// Maximum debug info
woopra.config({
debug: true,
ping: true
});
// Log all Woopra calls
const originalTrack = woopra.track;
woopra.track = function() {
console.log('[Custom] Track called:', arguments);
return originalTrack.apply(this, arguments);
};
Contact Support
If issues persist:
Collect debug information:
- Browser and version
- Woopra configuration (
woopra.config()) - Console errors/warnings
- Network request details
Visit Woopra Support:
- woopra.com/support
- Include debug information
- Describe expected vs actual behavior
Community Resources:
- Woopra documentation
- Developer forums
- Stack Overflow (tag: woopra)
Best Practices
Regular Testing
// Create a test suite
function runWoopraDiagnostics() {
console.group('Woopra Diagnostics');
// 1. Check if loaded
console.log('Loaded:', typeof woopra !== 'undefined');
// 2. Check configuration
console.log('Config:', woopra.config());
// 3. Test identification
woopra.identify({ email: 'test@example.com' });
console.log('Identification test sent');
// 4. Test event tracking
woopra.track('diagnostic_test');
console.log('Event test sent');
console.groupEnd();
}
// Run on page load
runWoopraDiagnostics();
Monitor in Production
// Log errors to your monitoring service
window.addEventListener('error', function(e) {
if (e.message.includes('woopra')) {
// Send to your error tracking service
console.error('Woopra error:', e);
}
});