This article covers the following:
Overview
The SmartCode is an automatically generated code snippet that enables Wingify on your website. To activate Wingify, 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 Wingify servers. With this code, the Wingify 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
Wingify provides support for two types of SmartCode that you can add to your website pages:
- Asynchronous SmartCode
- Synchronous SmartCode
Asynchronous SmartCode
Unlike the Synchronous Wingify code, Asynchronous Wingify code loads in parallel with your webpage and does not affect your website's loading time. Wingify's asynchronous code has a timer for page loading; if a page fails to load within the set time, execution stops and the original website is displayed instead. To learn more about asynchronous SmartCode, refer to Asynchronous SmartCode in Wingify.
To learn about how to add SmartCode to your website, refer to Configure 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 Wingify 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 Wingify.
Let us further understand how the Wingify SmartCode works.
How Does Wingify SmartCode Work?
Wingify servers interact with your website via the SmartCode (a JavaScript code snippet) you added to the web pages where Wingify tests and goals are running. Wingify uses this code to implement any changes on your test pages and render them accordingly.
- The code snippet you add to your website pages contacts the Wingify server whenever a visitor lands on a page where the Wingify code is running.
-
Wingify’s CDN decides which ones out of all the active tests are relevant for this page.
Note: If a test will actually run or not, it is computed in real-time on the visitors' browser.
- There are two parts of a response: static JavaScript code for running the test and dynamic test-specific data. These responses are cached on the Wingify server to minimize the response time. With code minification and gzipping, the duration of the response decreases even further.
- The server's response determines which DOM element in the control version should be replaced in the variations. For clicks, form submissions, or engagement goals, a Wingify function binds the click event on the page that checks if a conversion has occurred.
- The website is rendered after the implemented changes are loaded onto the website, to be displayed to your visitors. All this happens in milliseconds behind the screen.
Need more help?
For further assistance or more information, contact Wingify Support.