Load Justuno popups as quickly as possible for time sensitive use cases like age gates and landing pages
At a glance:
Introduction
Shopify Method
Bigcommerce Method
Magento Method
WooCommerce Method
Introduction
Loading JavaScript code for popups synchronously can be crucial for speeding up their functionality in scenarios where the popup is intended to trigger immediately upon a visitor loading a page. When JavaScript is loaded synchronously, the browser ensures that the script is fully parsed and executed before moving on to subsequent HTML or script processing. This guarantees that the necessary code for the popup is ready to run without delay, avoiding potential issues caused by asynchrony, such as incomplete execution or race conditions. This approach is especially valuable for critical user interfaces where responsiveness is key, as it prevents users from experiencing lags or unresponsive elements while waiting for deferred scripts to load asynchronously. However, this method should be used judiciously to avoid blocking the rendering of other elements on the page.
Make sure to place the following javascript as high up in the header of your site's theme code as possible to start it's loading quicker.
Look for the html tag <head> and place it above any other <script> tags that may be listed in there.
Shopify
Use the following for Shopify stores
Please ensure you replace the with your actual token id, make sure it's still wrapped with the quotes.
You can find your token ID from the right hand side of your Justuno's embed code page here. https://portal.justuno.com/app/account/embed-code
<script data-cfasync="false">
window.ju4_num="{{Your Justuno Account Token ID}}";
window.ju4_asset_host="https://justone.ai/embed";
window.ju4_pApi="https://justone.ai";window.ju4_api="https://api.justuno.com";
window.ju4app = window.ju4app || function() { (window.ju4app.q = window.ju4app.q || []).push(arguments); };
</script>
<script src="https://justone.ai/embed/ju_shopify_init.js?v=2"></script>
Bigcommerce
Use the following for Bigcommerce stores
Please ensure you replace the with your actual token id, make sure it's still wrapped with the quotes.
You can find your token ID from the right hand side of your Justuno's embed code page here. https://portal.justuno.com/app/account/embed-code
<script data-cfasync="false">
window.ju4_num="{{Your Justuno Account Token ID}}";
window.ju4_asset_host="https://justone.ai/embed";
window.ju4_pApi="https://justone.ai";window.ju4_api="https://api.justuno.com";
window.ju4app = window.ju4app || function() { (window.ju4app.q = window.ju4app.q || []).push(arguments); };
</script>
<script src="https://justone.ai/embed/ju_bigcommerce_init.js?v=2"></script>
Magento
Use the following for Magento stores
Please ensure you replace the with your actual token id, make sure it's still wrapped with the quotes.
You can find your token ID from the right hand side of your Justuno's embed code page here. https://portal.justuno.com/app/account/embed-code
<script data-cfasync="false">
window.ju4_num="{{Your Justuno Account Token ID}}";
window.ju4_asset_host="https://justone.ai/embed";
window.ju4_pApi="https://justone.ai";window.ju4_api="https://api.justuno.com";
window.ju4app = window.ju4app || function() { (window.ju4app.q = window.ju4app.q || []).push(arguments); };
</script>
<script src="https://justone.ai/embed/ju_magento_init.js?v=2"></script>
WooCommerce / Wordpress
Use the following for WooCommerce/Wordpress stores
Please ensure you replace the with your actual token id, make sure it's still wrapped with the quotes.
You can find your token ID from the right hand side of your Justuno's embed code page here. https://portal.justuno.com/app/account/embed-code
<script data-cfasync="false">
window.ju4_num="{{Your Justuno Account Token ID}}";
window.ju4_asset_host="https://justone.ai/embed";
window.ju4_pApi="https://justone.ai";window.ju4_api="https://api.justuno.com";
window.ju4app = window.ju4app || function() { (window.ju4app.q = window.ju4app.q || []).push(arguments); };
</script>
<script src="https://justone.ai/embed/ju_woocommerce_init.js?v=2"></script>
SEO Implications
Loading JavaScript code synchronously can negatively impact SEO because it blocks the browser from rendering other elements of the page until the script is fully loaded and executed. Search engines, particularly those with limited resources for rendering JavaScript-heavy content, may struggle to index the page correctly if critical content is delayed or blocked by synchronous scripts. This can lead to incomplete or inaccurate indexing, which may harm the page’s search rankings. Additionally, synchronous scripts increase the time to first meaningful paint (FMP) and total page load time, which are important metrics for both user experience and search engine algorithms. To balance performance and SEO, it’s important to use synchronous loading sparingly, ensuring it doesn’t disrupt the rendering of essential, crawlable content.