Skip to main content

Script Tags Loading Strategy for Your Store in Tolstoy platform

Script Tags Loading Strategy for Your Store

Mikaela Lasig avatar
Written by Mikaela Lasig
Updated today

When adding script tags to your store, choosing the correct loading strategy helps improve page speed, performance, and user experience. Two commonly used strategies are async and defer.
โ€‹

What is async?

Scripts marked as async are loaded in parallel with the rest of the page content.

  • The script downloads while the page is still loading

  • Once downloaded, it executes immediately

  • Page rendering may pause briefly during execution

Best used for:

  • Scripts that are independent of other scripts

  • Analytics, tracking pixels, or third-party tools that donโ€™t rely on page structure


What is defer?

Scripts marked as defer are also loaded in parallel, but they execute only after the HTML has fully loaded.

  • Page content loads first

  • Scripts run in order, after the page is parsed

  • Prevents scripts from blocking page rendering

Best used for:

  • Scripts that rely on the DOM (page elements)

  • Interactive widgets and UI functionality

Example use case:
Interactive widgets, shoppable video players, custom UI scripts


Why This Matters

Using async or defer correctly helps:

  • Improve page load speed

  • Reduce render-blocking scripts

  • Ensure scripts run at the right time

  • Deliver a smoother shopping experience

Recommended Strategy

  • Use async for tracking and analytics scripts

  • Use defer for interactive or visual features that depend on page content

Choosing the right loading strategy ensures your store stays fast while maintaining full functionality. ๐Ÿš€


Steps on how to change your Loading Strategy

  1. Select your Profile

2. Go to My Workspace, then select your loading strategy

Did this answer your question?