Place the Bootstrap.js synchronously in the HEAD section of your HTML in a blocking manner.
Blocking and non-blocking tags determine when a tag executes, that is, either before or after the web page appears.
Advantages of Placing Bootstrap.js in the HEAD
- Ensighten has a place to put code that must execute before displaying the page.
- You can swap content based on the same variables. This is especially useful with testing & optimization tools such as Test&Target, and performed to avoid flickering effects.
- You can use dynamic redirecting and data passing. You can decide in real-time where to send a user based on a variable such as a referrer or cookie, or data in conditions within Ensighten.
- You can include stylesheets or cross-browser compatibility shims that address issues on the site. This was used by one of our eCommerce customers to fix a shopping cart that was unexpectedly broken by a scheduled IT build.
- You can deploy performance-measuring tools since many tools need to deploy as close to the start of the page load as possible.
- You can provide the fastest execution for critical tags such as, analytics. We have found that executing a tag at the bottom of the page can lead to between 5-10% data loss! Late loading code can cause inconsistencies with user interaction tracking tools such as, link tracking, AJAX tracking, and others.
To Learn more, see also: Ensighten Bootstrapper Methods