Promotion Engine
Information about the core JavaScript script used to load Discount Ninja promotions on a Shopify storefront and apply the promotions to the available products and the cart.
Headless
Please note that Discount Ninja is not compatible with storefronts that use a headless implementation of Shopify as it relies on App embeds and App blocks.
Guiding principles
Performance
Performance is key in many areas and this is certainly true in eCommerce. Poor performance leads to frustration for visitors of your online store and results in loss of conversion potential.
What we do to ensure the best possible performance:
Vanilla JavaScript Implementation Our script and widgets are built entirely with Vanilla JavaScript, ensuring that they do not depend on external libraries or frameworks. This approach eliminates unnecessary bloat, reduces compatibility issues, and ensures seamless integration into any environment. By avoiding dependencies, we eliminate the risk of version conflicts and provide a lightweight, robust solution for developers.
Optimized for Minimal Size The script is carefully engineered to deliver the smallest possible payload. Through optimization techniques such as minification, and compression, we ensure that only the essential code is included. This minimizes download times, improves rendering performance, and reduces the overall bandwidth required, making the user experience faster and smoother, especially in resource-constrained environments.
Smart Caching Strategies To maximize efficiency, our engine leverages intelligent caching mechanisms. It stores frequently accessed data in the browser, significantly reducing the need for repeated network requests. Additionally, caching minimizes computation time by reusing pre-calculated data where possible, ensuring consistently fast performance even under high demand.
Continuous Performance Testing and Profiling We prioritize performance at every stage of development through rigorous testing and profiling. Using industry-standard tools and real-world scenarios, we regularly analyze the script’s behavior to identify potential bottlenecks and optimize for speed and efficiency. This iterative approach ensures that our solution consistently delivers top-tier performance across diverse environments.
Browser support
Comprehensive Browser Compatibility: The script is thoroughly tested across modern browsers, using progressive enhancements to ensure a consistent experience for all users.
All features used by the app are supported by modern browsers, including Chrome, Firefox, and Safari.
Extensibility
We include a rich client-side API that allows developers to interact with our script and extend the functionality of the promotion engine.
Last updated