Overview
This guide helps you diagnose and fix common StatCounter tracking issues. Most problems fall into a few categories: installation errors, configuration mistakes, data delays, or browser/platform conflicts.
Quick Diagnostic Steps
- Verify code installation - Check page source for tracking code
- Check project ID - Ensure it matches your dashboard
- Wait adequate time - Allow up to 30 minutes for data
- Test in incognito - Rule out ad blockers and cache issues
- Check dashboard - Verify you're viewing the correct project
Installation Issues
No Tracking Code Found
Problem: Tracking code is not present on your pages.
How to Diagnose:
// Open browser console (F12) and run:
if (document.body.innerHTML.includes('statcounter')) {
console.log('StatCounter code found');
} else {
console.error('StatCounter code NOT found');
}
Common Causes:
- Code not added to template
- Added to wrong file
- Removed during site update
- Theme override
- Plugin conflict
Solutions:
Verify Code Placement:
- Right-click page > View Page Source
- Press Ctrl+F (Cmd+F on Mac)
- Search for "statcounter"
- Code should appear before
</body>
Check All Pages:
- Test multiple pages on your site
- Ensure code is in global template
- Verify it appears on all page types
WordPress-Specific:
// Verify plugin is active // Go to Plugins > Installed Plugins // Look for "StatCounter" // Ensure status is "Active"Manual Installation:
- Re-add code to footer template
- Clear any caching
- Republish/redeploy site
Code Loading But Not Executing
Problem: Code is present but _statcounter is undefined.
How to Diagnose:
// Browser console
setTimeout(function() {
console.log(typeof _statcounter);
// Should show 'object', not 'undefined'
}, 3000);
Common Causes:
- JavaScript errors blocking execution
- Script URL incorrect
- Network blocking the script
- Content Security Policy blocking
Solutions:
Check Console for Errors:
- Open DevTools (F12)
- Go to Console tab
- Look for red error messages
- Fix any JavaScript errors
Verify Script URL:
<!-- Correct URL --> <script src="https://www.statcounter.com/counter/counter.js" async></script> <!-- Common mistakes --> <!-- Missing https:// --> <!-- Typo in domain name --> <!-- Wrong file path -->Check Network Tab:
- DevTools > Network
- Reload page
- Find counter.js request
- Status should be 200
- If 404/403, check URL
- If blocked, check CSP/firewall
Content Security Policy:
<!-- Add to CSP if needed --> <meta http-equiv="Content-Security-Policy" content="script-src 'self' https://www.statcounter.com; img-src 'self' https://c.statcounter.com;">
Duplicate Tracking
Problem: Same visit tracked multiple times.
How to Diagnose:
- Check Recent Visitor Activity
- Look for duplicate entries with same timestamp
- View page source for multiple code instances
Common Causes:
- Code in multiple locations
- Multiple plugins installing code
- Theme + manual installation
- Tag manager + direct code
Solutions:
Search for All Instances:
# In page source, search for: # Count how many times 'sc_project' appears # Should only appear onceCheck Common Locations:
- Theme footer.php
- functions.php
- Header injection
- Tag manager
- Plugins
Remove Duplicates:
- Keep only one installation method
- Disable conflicting plugins
- Remove manual code if using plugin
Tracking Code Visible on Page
Problem: StatCounter code or counter appears visibly on page.
How to Diagnose:
- View your website
- Look for visible code text or counter
- Check visibility setting
Solutions:
Invisible Mode:
// Ensure this is set to 1 var sc_invisible=1;Counter HTML Visible:
- Code may be outside HTML tags
- Ensure code is before
</body> - Check for broken HTML structure
Escape Special Characters:
// In some CMS, escape quotes var sc_security=\"abcd1234\";
Data Collection Issues
No Data Appearing in Dashboard
Problem: Code is installed but no data in dashboard.
How to Diagnose:
Verify Installation:
// Console check if (typeof _statcounter !== 'undefined') { console.log('Loaded correctly'); console.log('Project ID:', sc_project); }Check Project ID:
- Compare ID in code vs. dashboard
- Ensure you're viewing correct project
Common Causes:
- Wrong project ID
- Viewing wrong dashboard
- IP address blocked
- Normal processing delay
- Ad blocker enabled
Solutions:
Verify Project ID:
// In your code var sc_project=12345678; // In dashboard URL // statcounter.com/project/?project_id=12345678 // These MUST matchWait Adequate Time:
- Initial data: Up to 24 hours
- Regular updates: 5-30 minutes
- Don't panic if not immediate
Check IP Blocking:
- Dashboard > Config > IP Blocking
- Ensure your IP not blocked
- Remove or add to exceptions
Disable Ad Blocker:
- Test in incognito mode
- Disable browser extensions
- Try different browser
Clear Cache:
# Clear browser cache # Hard refresh: Ctrl+Shift+R (Windows) # Hard refresh: Cmd+Shift+R (Mac)
Data Delayed or Incomplete
Problem: Some visits tracked, others missing.
Common Causes:
- Ad blockers
- Privacy browsers
- JavaScript disabled
- Network issues
- Single page app not tracking routes
Solutions:
Understand Coverage:
- 25-40% of users use ad blockers
- 2% have JavaScript disabled
- Privacy browsers block tracking
- This is normal, expected
SPA Route Tracking:
// For Single Page Apps router.afterEach(() => { if (typeof _statcounter !== 'undefined') { _statcounter.record_pageview(); } });Check Timezone:
- Dashboard > Config > Project Settings
- Verify timezone is correct
- Mismatch causes confusing reports
Wrong Statistics
Problem: Data doesn't match expectations.
Common Causes:
- Timezone misconfiguration
- Session timeout setting
- Multiple projects confusion
- Counting own visits
Solutions:
Timezone Settings:
Exclude Own Visits:
- Config > IP Blocking
- Add your IP address
- Add office/team IPs
Session Timeout:
- Config > Session Timeout
- Default: 30 minutes
- Adjust if needed
Project Verification:
- Ensure viewing correct project
- Check project ID in URL
- Match to website
Browser and Platform Issues
Not Working in Specific Browsers
Problem: Tracking works in some browsers, not others.
Common Causes:
- Safari Intelligent Tracking Prevention
- Firefox Enhanced Tracking Protection
- Brave Shield blocking
- Browser extensions
Solutions:
Test Across Browsers:
- Chrome
- Firefox
- Safari
- Edge
- Brave
Check Privacy Settings:
Safari: - Preferences > Privacy - Uncheck "Prevent cross-site tracking" (for testing) Firefox: - Options > Privacy & Security - Standard/Strict affects tracking Brave: - Settings > Shields - Controls tracking/adsInform Users:
- Modern browsers block trackers
- This is expected behavior
- Cannot be bypassed
Mobile Tracking Issues
Problem: Tracking works on desktop, not mobile.
Common Causes:
- Mobile ad blockers
- AMP pages without code
- Mobile theme without code
- JavaScript errors on mobile
Solutions:
Test Mobile Directly:
- Use actual mobile device
- Don't rely on desktop responsive mode
- Test iOS and Android
Check Mobile Theme:
- Ensure code in mobile template
- Some sites have separate mobile themes
- Verify both have tracking code
AMP Pages:
- StatCounter doesn't work on AMP
- Implement alternative tracking
- Or disable AMP
Mobile Browser Console:
iOS Safari: - Settings > Safari > Advanced > Web Inspector - Connect to Mac for debugging Android Chrome: - chrome://inspect - Debug via desktop Chrome
WordPress-Specific Issues
Common Problems:
Plugin Conflicts:
// Deactivate other analytics plugins // Test with only StatCounter active // Reactivate one by one to find conflictTheme Conflicts:
- Switch to default theme temporarily
- If works, issue is with theme
- Contact theme developer
Caching Plugins:
- Clear all caches
- Temporarily disable caching
- Test tracking
- Re-enable caching
Security Plugins:
- Some block analytics scripts
- Whitelist statcounter.com
- Check firewall settings
Configuration Issues
Downloads Not Tracked
Problem: File downloads not appearing in reports.
Diagnostic Steps:
- Dashboard > Config > Configure Stats
- Check if "Track Downloads" is enabled
- Verify file extensions in list
Solutions:
Enable Download Tracking:
- Config > Configure Stats
- Toggle "Track Downloads" ON
- Add file extensions (pdf, zip, etc.)
Verify Link Format:
<!-- Correct: Direct link to file --> <a href="/files/document.pdf">Download</a> <!-- Won't track: JavaScript download --> <a href="#" <!-- Won't track: Data blob --> <a href="data:application/pdf...">Download</a>Test Download:
- Click download link
- Wait 15 minutes
- Check "Popular Downloads" report
Exit Links Not Tracked
Problem: External link clicks not recorded.
Solutions:
Enable Exit Link Tracking:
- Config > Configure Stats
- Enable "Track Exit Links"
Verify External Links:
<!-- Tracked (external domain) --> <a href="https://external-site.com">Link</a> <!-- NOT tracked (same domain) --> <a href="/page">Link</a> <a href="https://yourdomain.com/page">Link</a>Allow Time to Process:
- Data appears in 15-30 minutes
- Check "Exit Links" report
Cross-Domain Tracking Not Working
Problem: Sessions break between domains.
Expected Behavior:
- StatCounter doesn't link sessions across domains
- This is normal, not a bug
- Each domain = new session
Workarounds:
Use Same Project ID:
// On all domains, use identical code var sc_project=12345678; var sc_invisible=1; var sc_security="abcd1234";Accept Limitations:
- Sessions will break
- Referrer will show previous domain
- Can't create unified user journeys
Alternative Tools:
- Use Google Analytics for cross-domain
- Use both tools together
Debug Mode
Enable Debugging
Browser Console Debug:
// Check if loaded
console.log('StatCounter loaded:', typeof _statcounter !== 'undefined');
// Check configuration
console.log('Project ID:', typeof sc_project !== 'undefined' ? sc_project : 'Not set');
console.log('Invisible:', typeof sc_invisible !== 'undefined' ? sc_invisible : 'Not set');
// Monitor tracking calls
if (typeof _statcounter !== 'undefined' && _statcounter.record_pageview) {
var original = _statcounter.record_pageview;
_statcounter.record_pageview = function() {
console.log('StatCounter pageview fired');
return original.apply(this, arguments);
};
}
Network Monitoring
Track Network Requests:
- Open DevTools (F12)
- Go to Network tab
- Filter: statcounter
- Reload page
- Look for:
- counter.js (should be 200 OK)
- Image pixel request (tracking beacon)
Test Mode
Create Test Page:
<!DOCTYPE html>
<html>
<head>
<title>StatCounter Test</title>
</head>
<body>
<h1>StatCounter Test Page</h1>
<p>If tracking works, this visit will appear in dashboard.</p>
<!-- Your StatCounter Code -->
<script type="text/javascript">
var sc_project=12345678;
var sc_invisible=1;
var sc_security="abcd1234";
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js" async></script>
<!-- Debug Script -->
<script>
window.addEventListener('load', function() {
setTimeout(function() {
if (typeof _statcounter !== 'undefined') {
document.body.innerHTML += '<p style="color:green;">✓ StatCounter loaded successfully</p>';
console.log('StatCounter object:', _statcounter);
} else {
document.body.innerHTML += '<p style="color:red;">✗ StatCounter failed to load</p>';
}
}, 3000);
});
</script>
</body>
</html>
Common Error Messages
"Invalid Project ID"
Cause: Project ID in code doesn't match any project in your account.
Solution:
- Log in to StatCounter
- Go to your project
- Check project ID in URL or settings
- Update code with correct ID
"Security Code Mismatch"
Cause: Security code incorrect or changed.
Solution:
- Dashboard > Config > Reinstall Code
- Copy fresh code with current security code
- Replace old code with new code
"Quota Exceeded"
Cause: Free plan visitor limit reached.
Solution:
- Upgrade to paid plan
- Or wait for next billing cycle
- Or reduce tracked pages
Advanced Troubleshooting
Compare with Other Analytics
If StatCounter shows different numbers than Google Analytics:
This is Normal:
- Ad blocker rates differ
- Counting methods differ
- Bot filtering differs
- Session definitions differ
What to Check:
- Both tracking correctly?
- Similar ballpark numbers?
- Consistent trends?
- No duplicate tracking?
Server Logs vs StatCounter
Server logs show more traffic because:
- Bots make server requests
- Ad blockers don't block server
- JavaScript failures don't affect server
- Crawlers hit server
StatCounter shows less because:
- Only counts JavaScript execution
- Blocked by ad blockers
- Privacy browsers block
- This is accurate human traffic
Validation Checklist
Run through this checklist:
- Code present on all pages
- Project ID correct
- Security code matches
- No JavaScript errors
- Not blocked by ad blocker (test in incognito)
- Network requests successful
- Waited 24 hours for initial data
- Viewing correct project
- Timezone set correctly
- IP not blocked
Getting Help
Before Contacting Support
Gather this information:
- Your website URL
- Project ID
- Screenshot of dashboard
- Page source showing code
- Browser console screenshot
- Network tab screenshot
- Description of issue
- Steps to reproduce
StatCounter Support
Free Users:
- Knowledge Base
- FAQs
- Community Forum
Paid Users:
- Email support
- Priority response
- Technical assistance
Support Resources
Quick Reference Table
| Issue | Quick Fix |
|---|---|
| No data after 24hrs | Verify project ID, check code placement |
| Code not loading | Check console errors, verify script URL |
| Duplicate tracking | Remove duplicate code instances |
| Downloads not tracked | Enable in Config > Configure Stats |
| Mobile not working | Verify code in mobile template |
| Wrong stats | Check timezone, exclude own IP |
| Ad blocker blocking | Expected, test in incognito |
| SPA not tracking | Add manual pageview calls on route changes |
| Cross-domain issues | Use URL parameters, accept limitations |
| Data delayed | Normal up to 30 minutes, wait patiently |