This guide helps you diagnose and fix common issues with Kentico Xperience websites, focusing on performance optimization and analytics tracking.
Quick Reference
Performance Issues
Tracking Issues
Common Issue Categories
Performance & Core Web Vitals
Kentico is a .NET-based platform that requires optimization for optimal Core Web Vitals scores:
Common Issues:
- Slow server response times (TTFB)
- Unoptimized images from Media Library
- Excessive ViewState in Portal Engine
- Unminified CSS/JavaScript
- Third-party script blocking
- Database query performance
Quick Wins:
- Enable output caching
- Optimize media library images
- Use CDN for static assets
- Minimize ViewState usage
- Implement lazy loading
Analytics Tracking
Common Issues:
- Tags not loading on specific page types
- E-commerce events not firing
- Duplicate tracking calls
- Missing data in reports
- Staging environment tracking production
Quick Checks:
- Verify tracking code in layout files
- Check browser console for errors
- Use tag debugging tools
- Review conditional loading logic
- Test in GTM Preview mode
Diagnostic Tools
Built-in Kentico Tools
1. Debug Mode
Enable Kentico debug mode to identify performance bottlenecks:
<!-- web.config -->
<configuration>
<appSettings>
<add key="CMSDebugEverything" value="true" />
<add key="CMSDebugFiles" value="true" />
<add key="CMSDebugSQL" value="true" />
<add key="CMSDebugCache" value="true" />
</appSettings>
</configuration>
Access debug panel: yoursite.com?debug=1
2. System Application Logs
Check for errors:
3. Health Monitoring
Monitor system health:
- System → Health monitoring
- Check:
- Application performance
- Database performance
- Cache statistics
- Request processing time
External Tools
Google PageSpeed Insights
- Test: https://pagespeed.web.dev/
- Provides Core Web Vitals scores
- Identifies specific issues
- Offers optimization suggestions
Google Tag Assistant
- Chrome extension for tag debugging
- Validates GTM, GA4, Meta Pixel
- Shows tag firing sequence
- Identifies configuration errors
Chrome DevTools
- Network tab for resource loading
- Performance tab for Core Web Vitals
- Console for JavaScript errors
- Application tab for cookies/storage
Performance Optimization Checklist
Server-Side Optimization
- Enable output caching for pages
- Configure SQL Server performance
- Optimize database indexes
- Enable compression (Gzip/Brotli)
- Use full-page caching when possible
- Optimize ViewState (Portal Engine)
- Review expensive macros
- Implement partial caching for web parts
Client-Side Optimization
- Minify CSS and JavaScript
- Combine resource files
- Use browser caching headers
- Implement lazy loading for images
- Optimize Media Library images
- Load scripts asynchronously
- Remove unused CSS/JS
- Use image CDN
Database Optimization
- Rebuild database indexes regularly
- Archive old event log entries
- Clean up staging tasks history
- Optimize custom queries
- Use database caching
- Monitor slow queries
- Update statistics
Tracking Troubleshooting Checklist
Basic Checks
- Tracking code present in page source
- Tracking ID/Container ID is correct
- No JavaScript errors in console
- Tags load in correct order
- Environment checks not blocking
- Consent management not preventing load
- Ad blockers disabled for testing
GTM-Specific
- Container published (not just saved)
- Triggers configured correctly
- Variables populated with values
- No tag firing conflicts
- Data layer structure correct
- Preview mode shows tags firing
GA4-Specific
- Measurement ID format correct (G-XXXXXXXX)
- Config tag fires on all pages
- Event names match conventions
- Parameters have correct data types
- DebugView shows events
- Realtime report shows activity
Meta Pixel-Specific
- Pixel ID correct (15-16 digits)
- Base code loads before events
- Meta Pixel Helper shows no errors
- Events appear in Events Manager
- Parameters formatted correctly
- No duplicate pixels
Common Error Messages
Kentico-Specific Errors
"ViewState validation error"
Cause: ViewState tampering or timeout (Portal Engine)
Solution:
<!-- web.config -->
<pages enableViewStateMac="true" viewStateEncryptionMode="Always">
<namespaces>
<add namespace="System.Web.Mvc" />
</namespaces>
</pages>
"The page has been changed by another user"
Cause: Content locking or concurrent editing
Solution:
- Check out and check in the document
- Clear browser cache
- Check workflow status
"SQL timeout exception"
Cause: Slow database query or connection
Solution:
<!-- ConnectionStrings.config -->
<add name="CMSConnectionString"
connectionString="...;Connection Timeout=120;" />
JavaScript Errors
"gtag is not defined"
Cause: GA4 script not loaded
Solution:
- Verify script is in
<head> - Check for JavaScript errors blocking execution
- Ensure script loads before event code
"fbq is not defined"
Cause: Meta Pixel not loaded
Solution:
- Verify pixel base code is present
- Check loading order
- Look for Content Security Policy blocking
"dataLayer is not defined"
Cause: GTM not loaded or data layer pushed too early
Solution:
// Always initialize
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ /* data */ });
Environment-Specific Issues
Staging vs Production
Problem: Tracking fires on staging environment
Solution:
@{
var isProduction = SiteContext.CurrentSite.SiteName == "ProductionSite";
var trackingEnabled = SettingsKeyInfoProvider.GetBoolValue("EnableTracking", SiteContext.CurrentSiteID);
}
@if (isProduction && trackingEnabled)
{
<!-- Tracking code here -->
}
Multi-Site Issues
Problem: Wrong tracking IDs on different sites
Solution:
@{
// Get site-specific settings
var siteId = SiteContext.CurrentSiteID;
var gtmId = SettingsKeyInfoProvider.GetValue("GoogleTagManagerID", siteId);
}
Caching Issues
Output Caching Problems
Problem: Cached pages show old tracking codes
Solution:
- Clear output cache: System → Clear cache
- Exclude tracking code from caching:
<!-- This won't be cached -->
<% Response.WriteSubstitution(GetTrackingCode); %>
@functions {
public static string GetTrackingCode(HttpContext context)
{
// Return tracking code
return "<!-- tracking code -->";
}
}
Browser Caching
Problem: Old scripts cached in browser
Solution:
- Add version parameter to scripts
- Set appropriate cache headers
- Use cache busting:
script.js?v=2.0
Portal Engine vs MVC Differences
Tracking Implementation
| Aspect | Portal Engine | MVC |
|---|---|---|
| Layout location | Master pages | _Layout.cshtml |
| Code access | Web Parts | Controllers/Views |
| Macro usage | Extensive | Limited |
| ViewState | Present | Not applicable |
| Performance | Slower | Faster |
Migration Considerations
When moving Portal Engine to MVC:
- Reimplement web parts as widgets/sections
- Convert macros to Razor syntax
- Remove ViewState dependencies
- Update tracking code placement
- Test all tracking events
Getting Help
Kentico Resources
- Documentation: https://docs.kentico.com/
- DevNet Forums: https://devnet.kentico.com/
- Knowledge Base: https://support.kentico.com/
- GitHub: https://github.com/Kentico
Analytics Resources
- Google Analytics Help: https://support.google.com/analytics
- GTM Community: https://www.en.advertisercommunity.com/
- Meta Business Help: https://www.facebook.com/business/help
When to Contact Support
Contact Kentico support if:
- System errors in event log
- Database corruption issues
- Licensing problems
- Upgrade/migration issues
- Performance degradation after updates
Performance Monitoring
Set Up Monitoring
Application Insights (Azure)
- Monitor server performance
- Track exceptions
- Analyze request metrics
Google Analytics
- Track page load times
- Monitor Core Web Vitals
- Analyze user experience
New Relic / Datadog
- APM for .NET applications
- Database query monitoring
- Custom instrumentation
Key Metrics to Monitor
- TTFB: < 600ms (good)
- LCP: < 2.5s (good)
- FID/INP: < 100ms (good)
- CLS: < 0.1 (good)
- Server CPU: < 70%
- Database response: < 100ms
Preventive Maintenance
Regular Tasks
Weekly:
- Check event log for errors
- Review health monitoring
- Monitor disk space
Monthly:
- Clear old event log entries
- Archive staging tasks
- Review performance metrics
- Update tracking documentation
Quarterly:
- Rebuild database indexes
- Review and optimize queries
- Update Kentico (minor versions)
- Security patch installation
Annually:
- Major version upgrades
- Performance audit
- Security audit
- Tracking audit
Best Practices
- Use Staging Environment: Always test changes before production
- Enable Logging: Keep logs for troubleshooting
- Monitor Performance: Regular performance checks
- Document Changes: Keep change log for tracking implementations
- Test Thoroughly: Test all scenarios before deployment
- Use Version Control: Track all code changes
- Regular Backups: Database and file system backups
- Stay Updated: Keep Kentico and libraries updated
Next Steps
Based on your issue, refer to the specific troubleshooting guide:
Performance Issues:
Tracking Issues:
Integration Guides: