Before You Begin
Check your PureClarity display mode setting in Stores > Configuration > PureClarity > Mode to determine which HTML syntax to use.Direct HTML integration requires theme customization and should be performed by developers familiar with Magento theme structure.
HTML Syntax by Mode
Client-Side Mode HTML
For installations using client-side display mode:- Minimal markup required
- JavaScript-driven content insertion
- Asynchronous loading of recommendations
- PureClarity-managed templates and styling
Server-Side Mode HTML
For installations using server-side display mode:- Multiple attributes for server processing
- Magento-rendered content
- Custom template control
- Server-side data integration
Using the wrong HTML syntax for your mode will prevent zones from displaying. Always verify your configuration mode before implementing HTML zones.
Zone ID Configuration
Zone ID Format
ReplaceZONE-ID
in the HTML examples with your actual PureClarity zone identifier:
Examples:
- Homepage hero:
HP-01
- Category page recommendations:
CAT-01
- Product page cross-sells:
PDP-01
- Search results:
SR-01
Zone ID Best Practices
- Use descriptive naming - Clear identification of zone purpose
- Maintain consistency - Standardized naming across your site
- Document zone mapping - Keep records of zone placements
- Coordinate with campaigns - Ensure zone IDs match PureClarity admin
Zone IDs must exactly match the zone identifiers configured in your PureClarity campaigns. Mismatched IDs will result in empty zones.
Template Integration Locations
Common Integration Points
Theme Files:app/design/frontend/[Vendor]/[theme]/Magento_Catalog/templates/
app/design/frontend/[Vendor]/[theme]/Magento_Checkout/templates/
app/design/frontend/[Vendor]/[theme]/Magento_Cms/templates/
- Homepage sections - In CMS page templates
- Category pages - In category view templates
- Product pages - In product detail templates
- Cart/Checkout - In shopping cart templates
Example Integrations
Homepage Hero Zone
Category Page Recommendations
Product Page Cross-Sells
Advanced HTML Integration
Conditional Zone Display
Responsive Zone Implementation
Fallback Content
Fallback content provides a backup when PureClarity services are unavailable, ensuring your site maintains functionality and appearance.
CSS Styling Considerations
Zone Container Styling
Responsive Design
Theme Integration
Performance Optimization
Lazy Loading Zones
Preload Critical Zones
Minimize Layout Shift
Layout shifts can negatively impact user experience and Core Web Vitals scores. Always reserve appropriate space for zone content.
Testing HTML Integration
Validation Checklist
- Syntax verification - Correct HTML for your mode
- Zone ID accuracy - Matches PureClarity campaign configuration
- Template compilation - No Magento compilation errors
- Content loading - Zones display recommendations correctly
- Responsive behavior - Works across all device sizes
- Fallback functionality - Graceful degradation when needed
Debug Mode Testing
Enable Zone Debug Mode to visualize zone placement:- Enable debug mode in PureClarity configuration
- Clear Magento cache to apply changes
- Visit pages with HTML zones
- Verify zone placement and identifiers
Common Implementation Issues
Zone Not Displaying
Troubleshooting steps:- Verify HTML syntax matches your configuration mode
- Check zone ID in both template and PureClarity admin
- Clear all caches (layout, blocks, page cache)
- Confirm template compilation without errors
- Test with debug mode enabled
Incorrect Content
Possible causes:- Zone ID mismatch between template and campaigns
- Mode configuration doesn’t match HTML syntax
- Campaign inactive or incorrectly configured
- Feed data out of sync
Performance Issues
Optimization strategies:- Minimize zone count on single pages
- Use appropriate caching strategies
- Implement lazy loading for below-fold zones
- Monitor server impact for server-side mode
Maintenance Best Practices
Version Control
- Track template changes in version control systems
- Document zone additions and modifications
- Test across environments before production deployment
- Maintain rollback capabilities for problematic changes
Regular Auditing
- Review zone performance quarterly
- Validate zone placement after theme updates
- Check campaign alignment with business goals
- Monitor user engagement with zone content
Update Procedures
- Test zone functionality after Magento updates
- Verify template compatibility with new versions
- Update documentation when zones are modified
- Coordinate with marketing on campaign changes
Related Resources
Alternative Integration Methods
- Adding Zones Using Widgets - GUI-based zone placement
- Default Zone Installation - Standard zone setup
Configuration Guides
- Configuration Mode - Understanding client-side vs server-side
- Zone Debug Mode - Troubleshooting zone placement
Advanced Topics
- Server-Side Mode - Advanced server-side implementation
- Custom Templates - PureClarity template customization