Preview mode and live mode in our AB testing platform handle experiment data differently, which impacts how they function and perform.
Data Loading Process
Preview Mode
Preview mode loads experiment data asynchronously through these steps:
- When you access preview mode, it fetches experiment data dynamically
- The data is inserted into the JavaScript script using a query string parameter
This approach provides flexibility for testing and rapid iterations
Live Mode (Production)
Live mode handles experiment data through bundling:
- Experiment data is pre-bundled into the compose script during deployment
- The data is immediately available when the script loads
This ensures optimal performance in production
Key Benefits
Preview Mode Benefits
- Faster iteration cycles for testing
- Easier development workflow
- Immediate visibility of experiment changes
- No need to rebuild for testing new variations
Live Mode Benefits
- Better performance due to bundled data
- More reliable in production environments
- No additional network requests for experiment data
- Optimized for end-user experience
Technical Implementation Notes
The asynchronous nature of preview mode is intentionally designed to:
- Facilitate rapid development
- Simplify the build process
- Enhance the preview experience
- Enable quick experimentation without rebuilds
Important Considerations for Async Preview Mode
The asynchronous nature of preview mode can lead to subtle differences in user experience compared to live mode. These differences are important to consider when implementing and testing variants:
- Timing variations in content loading
- Potential flash of original content
- Different initialization sequences
- Race conditions in certain implementation patterns
To ensure consistent behavior between preview and live modes, please follow our variant best practices guide. For additional implementation details or questions, please contact the platform team.
```