close this to read article
This article covers the following:
Overview
The Synchronous SmartCode loads synchronously, ensuring it executes in the order it appears on the page. It is typically used when strict control over script execution order is required.
To access your synchronous SmartCode:
- Navigate to Configurations > Websites and Apps >
- Select your Website from the list of websites. In the HTML tab, the Asynchronous SmartCode is shown by default.
- To switch to the Synchronous version, click More options (vertical ellipsis) in the top-right corner of the SmartCode panel, and select the Settings icon (⚙)
- From the Customize Settings dialog, select Synchronous.
Key Advantages
- Smarter Caching: The browser caches responses from Wingify's servers. On subsequent requests, the server checks whether anything has changed. If nothing is new, the server returns a 304 (Not Modified) response and the browser serves content from cache keeping load times fast. If there are updates, the new content is fetched and cached.
- Faster Execution: Settings and libraries are now bundled into a single, pre-loadable request. Previously, dynamic parameters were appended to requests during execution, which delayed the loading of Wingify settings and libraries. This change allows the browser to execute Wingify code significantly faster.
- Built-in Single Page Application (SPA) Support: SPA compatibility is enabled by default, with no additional configuration needed.
The Workflow of Synchronous SmartCode in Wingify
Despite the improvements, document.write() is still used in limited, specific scenarios to:
- Ensure previews and heatmaps continue to function as expected.
- Fetch cookies for multi-domain campaigns. If the call is blocked, fallback methods are used automatically.
Need more help?
For further assistance or more information, contact Wingify Support.