The SmartCode is an automatically generated code snippet that enables VWO on your website. To activate VWO, the SmartCode must be placed before the </head> tag in your website's HTML. You can access your unique SmartCode by navigating to Configurations > Websites and Apps > Introduction > SmartCode for Websites (Client-Side). Once there, register your domain to generate the SmartCode for your site.
This code snippet contains a unique Account ID that allows your website to interact with VWO servers. With this code, the VWO servers understand the changes you have implemented on your website and render the pages accordingly. Once this setup is done, the updated content is displayed to your website visitors.
Types of SmartCode in VWO
VWO provides support for two types of SmartCode that you can add to your website pages:
Asynchronous SmartCode
Unlike the Synchronous VWO code, Asynchronous VWO code loads in parallel to your webpage and does not affect the loading time of your website. VWO asynchronous code has a timer set for the pages to load, and if a page fails to load within the set time, the execution stops, and the original website is displayed instead. To learn more about asynchronous SmartCode, refer to Asynchronous SmartCode in VWO.
To learn about how to add SmartCode to your website, refer to Configuring SmartCode for your Website.
Synchronous SmartCode
Synchronous code executes each function or statement in an HTML code sequentially. If the synchronous code fails to execute, it will block further execution of the code, thereby delaying the page load time. For example, consider that you have added VWO synchronous code in the head of your webpage’s HTML code and it fails to execute for some reason. In such a scenario, the web page will not load for your visitor. To learn more about synchronous SmartCode, refer to Synchronous SmartCode in VWO.