Troubleshooting Salesforce Commerce Cloud
This section covers common issues and solutions for analytics and tracking on Salesforce Commerce Cloud (SFCC).
Common Issue Categories
Performance Issues
Performance problems affect user experience and can impact tracking accuracy.
- LCP (Largest Contentful Paint) - Slow page load issues
- CLS (Cumulative Layout Shift) - Layout stability problems
Tracking Issues
Problems with analytics data collection and accuracy.
- Events Not Firing - Missing or incomplete tracking
SFCC-Specific Considerations
Caching Behavior
SFCC uses aggressive caching that can affect tracking:
- Page Cache - Full page caching can prevent dynamic data layer values
- Component Cache - Cached ISML components may have stale data
- CDN Caching - Edge caching can serve outdated tracking scripts
Solutions for Caching
// Use cache-bust parameters for critical tracking
<iscache type="relative" hour="0" minute="0"/>
// Or use pdict data in scripts to ensure fresh values
<script>
var userData = {
loggedIn: <isprint value="${customer.authenticated}" encoding="jsstring"/>,
sessionId: '<isprint value="${session.sessionID}" encoding="jsstring"/>'
};
</script>
Pipeline vs Controller Architecture
SFRA (Controllers):
- Modern JavaScript-based
- Easier debugging
- Clear request lifecycle
SiteGenesis (Pipelines):
- Legacy XML-based
- Complex debugging
- Multiple execution points
Quick Diagnostic Checklist
Page Load Issues
- Check browser console for JavaScript errors
- Verify GTM/GA scripts are loading
- Check Network tab for failed requests
- Review SFCC error logs in Business Manager
Data Layer Issues
- Verify
window.dataLayerexists - Check data layer values in console
- Confirm data layer pushes before GTM loads
- Validate JSON structure in data layer
Event Tracking Issues
- Use GA4 DebugView or GTM Preview
- Check trigger conditions in GTM
- Verify event parameters are populated
- Test in incognito mode (no extensions)
Business Manager Logs
Access SFCC logs for debugging:
Administration > Site Development > Development Setup
Key log files:
error-log- JavaScript and server errorscustom-log- Custom logging outputmigration-log- Import/export issues
Support Resources
- Salesforce Commerce Cloud Documentation
- SFCC Developer Center
- Global Issues Hub - Platform-agnostic troubleshooting