INFO: We are introducing a module called, Deployments, which is in beta version and will be rolled out in phases. If your account is enabled with the Deployments module, the SmartCode for your website will be available under the respective deployment that can be accessed by navigating from the main menu > Configurations > Deployments > Deployments.
You can customize your Wingify SmartCode in the following ways:
NOTE:
To check if you have correctly installed the SmartCode on your webpage, use the SmartCode Checker. You can find it in Configurations > Websites and Apps > Your Website. See SmartCode Checker in Wingify to know what different results mean.
Modify the Cookie Duration
Wingify uses cookies to identify visitors and keep track of the variation they accessed. The default duration of a Wingify cookie is 100 days. To change the duration, you can add the following JavaScript code snippet before the Wingify tracking code on your webpage.
NOTE: If you modify a cookie value, it would be applicable to all the cookies that are dropped by Wingify on your browser.
In this example, the cookie will last for a day only. Change the value from 1 to the number of days you want the cookie to be stored. Once the cookies are created, the duration cannot be altered.
<script type = 'text/javascript' >
_vis_opt_cookieDays = 1,
</script>Note: When you change the cookie duration, there is a possibility of a data discrepancy.
You can also modify the cookie duration through the Customise SmartCode settings within the Wingify dashboard.
- Navigate to Configurations > Websites and Apps.
- Select the specific website for which you want to configure the cookie duration.
- Navigate to Code > HTML.
- From the SmartCode section, click and select Settings. This opens the Customise SmartCode dialog box.
- Select the Cookie configuration checkbox.
- In the Cookie duration field, specify how long Wingify cookies should persist in the visitor's browser, for example, 30 days, and click Save.
Once you set the cookie duration, the cookie will persist in the user's browser for the specified duration.
Configure Timeout Interval
By default, the time-out values for the two parameters are 2000 and 2500 milliseconds, respectively. Using the following two parameters of the SmartCode, you can change the time-out interval to counter issues like slow Internet connections or incompatible IE browsers. You can set the time for which the asynchronous script will wait for the page settings to load, using the variable settings_tolerance. If the page settings load within this time interval, the code requests the Wingify library (va.js or vanj.js) from our CDN and waits for the file to load at the interval indicated by the variable library_tolerance.
<script type = 'text/javascript' >
settings_tolerance = 2000,
library_tolerance = 2500,
</script>Hide an Element
You can customize the SmartCode to hide an element on your webpage. This can be done using the “hide_element” field of the SmartCode. The default functionality of the asynchronous SmartCode is to hide the body of the web page initially. This is to avoid any flash of the original content on the web page while Wingify applies any change.
If you wish to override the default functionality of the asynchronous SmartCode, you can replace the “body” with an empty string. The example code:
| <script type = 'text/javascript' > |
|---|
| hide_element = '', |
| </script> |
If you make this change, you might encounter issues like a flash of original content on the web page.
Set Domain for Wingify Cookies
In case Wingify cookies are not stored on your domain by default, use the following code to set the domain on which the cookies should be stored. This code snippet must be added before the Wingify tracking code on your webpage.
| <script type='text/javascript'> |
|---|
| var _vis_opt_domain = 'yourdomain.com', |
| </script> |
You can also specify the exact domain for storing cookies by configuring it in the Customize SmartCode settings within your Wingify dashboard.
- Navigate to Configurations > Websites and Apps.
- Select the specific website for which you want to configure the cookie domain.
- Navigate to Code > HTML.
- From the SmartCode section, click and select Settings. This opens the Customise SmartCode dialog box.
- Select the Cookie configuration checkbox.
- In the Cookie domain field, specify the domain, for example, wingify.com.
Once the cookie domain is specified in the Customise SmartCode settings, Wingify cookies will be stored on that domain. Use Webpage’s jQuery Instead of Wingify’s
You have the option to use the jQuery of your webpage instead of Wingify’s jQuery. This typically depends on the jQuery version of your webpage. If the jQuery version of your webpage is similar or higher than the one used by Wingify, your page can use its own jQuery. Currently, the jQuery version used by Wingify is 1.4.2. As of now, the supported jQuery versions range from 1.4.2 to 2.x.x.
INFO: If your account ID is higher than or equal to 460038, we do not serve you with jQuery version 1.4.2. Instead, we serve you with a customized version that is five times smaller. We did this to ensure that your website remains performant enough while using Wingify. Please read this blog to see what we did for this.
Accounts with IDs lower than the one specified above are unaffected and will continue to function normally.
If you are already using jQuery on your webpage, and the version is in the specified range, we recommend you to use the no Jquery version as it would reduce the required bandwidth and would work faster. The example code:
For Synchronous SmartCode:
| <!-- Wingify One Smartcode (Replace <ACCOUNTID> with your Wingify account id) --> |
|---|
| <script src = "https://dev.visualwebsiteoptimizer.com/lib/<ACCOUNTID>_nojq.js"> </script> |
usingJqueryForSyncCode.js hosted with ❤ by GitHub
For Asynchronous SmartCode:
| <script type='text/javascript'> |
|---|
| use_existing_jquery=false, |
| </script> |
Set the Cookie Path
You can specify the URL path within your website’s domain where Wingify cookies will be active (for example, /sites/one/page). If the path is set to the default, which is just a forward slash (/), it means the cookie is active and used on every single page of the entire website. This is what most tracking tools, like Wingify, do to ensure they track the visitor regardless of the page they visit.
-
Example: A cookie path configured as ‘/’ works across the website such as /pricing, /about, and the /homepage
If you set a specific path, such as /checkout, the cookie will be used and sent to the server only when the visitor is on pages that start with that path (such as /checkout/billing).
- Example: A cookie path configured as /blog will not be used on the /pricing page or the /homepage.
To set the cookie path:
- Navigate to Configurations > Websites and Apps.
- Select the specific website for which you want to configure the cookie path.
- Navigate to Code > HTML.
- From the SmartCode section, click and select Settings. This opens the Customise SmartCode dialog box.
- Select the Cookie configuration checkbox.
- In the Cookie path field, specify the path, for example, /wingify.
Once you set the cookie path, the cookie will only be sent when the user visits URLs that begin with the specified path. Note: The browser considers the default path as ‘/’ if you do not set a cookie path.
Custom URL Setup
When a campaign has to run on multiple pages with no common pattern in the URL’s or when a campaign needs to run on specific pages, and the URL pattern matches with a lot of pages that do not have to be included, then a Custom URL can be used to create a pattern that matches your requirements. Using custom URLs, you can assign virtual URLs to the pages so that a specific pattern can be generated. The example code:
| //Replace NEW_VIRTUAL_PAGE_URL with your customized URL) |
|---|
| window.Wingify = window.Wingify || []; |
| window.Wingify.push(['activate', { |
| virtualPageUrl: 'NEW_VIRTUAL_PAGE_URL' |
| }]); |
NOTE: To know how to set up a custom URL for asynchronous and synchronous SmartCodes, refer to Asynchronous SmartCode in Wingify and Synchronous SmartCode in Wingify.