How Does VWO Smart Code Work?

Last updated

VWO servers interact with your website through the JavaScript code snippet added to all the pages on which VWO tests and goals are running. VWO uses the code to implement any changes on your test pages and render them accordingly to your visitors.

  1. The code snippet you add to your website pages contacts the VWO server whenever a visitor lands on a page where the VWO code is running.
  2. The VWO server determines whether it should run the test or not for the visitor (based on your segmentation settings) and sends a response.
  3. 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 VWO server to minimize the response time. With code minification and gzipping, the duration of response decreases even further.
  4. The response from the server determines which DOM element on the control version should be replaced in the variations. For clicks, form submissions, or engagement goals, a VWO function binds the click event on the page that checks if a conversion has occurred.
  5. The website is rendered after the implemented changes are loaded on the website, to be displayed to your visitors. All this happens in milliseconds behind the screen.
PRO-TIP VWO provides two types of tracking code to add to your website pages—Synchronous code and Asynchronous code. To understand the difference between the two, click here.

VWO Network Calls

During any test, VWO uses a number of network calls between your website and VWO servers. Here’s a list explaining what each call does:

Fetch Test Settings

j.php

Asynchronous VWO Smart Code makes this call-to-fetch test settings based on the current URL. It includes data of all the changes that need to be applied to the page and rendered to the visitor. The data format varies depending on the type of test that is running—A/B testing, Split URL, Multivariate testing (MVT), Visitor Analysis, Surveys, and so on.

js_visitor_settings.php

Synchronous code makes this call-to-fetch test settings on the current URL. This call performs the same function as j.php does for Asynchronous code.

Library Calls

Library calls are a core component of VWO that read and apply test settings. You can track goal conversions and attach different event listeners on the test pages. These calls are important to implement changes during an A/B, MVT, Personalization, and other test types. In case of Split URL test, the library redirects the URL to the variations.

va.js

Asynchronous code makes this call to send information about the jQuery version used by VWO.

vanj.js

Asynchronous code makes this call to send information about the jQuery version used by your website.

vis_opt.js

Synchronous code makes this call to to send information about the jQuery version used by VWO.

vis_opt_no_jquery.js

Synchronous code makes this call to send information about the jQuery version used by your website.

Pixels Calls

l.gif

This call is for visitor tracking. As soon as a visitor lands on your website and becomes a part of the test, l.gif comes into action.

h.gif

This call is used to create a heatmap based on the visitor clicks on your website. As soon as a user clicks any part of the web page, h.gif is called. By default, in a single session, this call can be fired 3 times at the most. On the fourth click, h.gif won’t be fired. However, this value is customizable, and you can change it to track as many clicks as you want.

c.gif

This is the call that tracks goal conversions. Goal conversions are tracked only when the c.gif call is fired. This call contains the goal ID, which is unique to every goal in your test.

v.gif

This call is for internal purposes and tracks unique visitors for an account. It also tracks the visitor settings timeout events.

Was this article helpful?

Thanks for your feedback!
Please email us at support@vwo.com to tell us what you were looking for. We'll send the answer to your inbox.

Contact Us / Login

Product
Resources Home