Host VWO JavaScript Files on Your Server

Last updated

With JavaScript files hosted on your server, your website doesn’t need to contact a VWO server for loading test variations.

Why Self-Host the Test Files

As a website owner, you may be skeptical about using external JavaScript from a third party. For your requirements, you may want to remove dependency on VWO servers and have all the test resources under your control. Using the self-hosting option, you can store the VWO JavaScript files locally to ensure that the test settings, files, and code for your tests reside on your server.

For such self-hosting websites, the VWO servers only register visits and conversions. Typically, self-hosting is more relevant if VWO Content Delivery Network (CDN) does not have a node in or near your country.

ATTENTION VWO does not have any control over the JavaScript files hosted on your local servers. You receive email notification for any updates required to the files (due to bug fixes and feature changes).

How to Host VWO JavaScript Files On Your Server

host-java

  1. To use the self-hosting option, go to the Finalize screen of the VWO test creation process.
  2. On the Finalize screen, click Advanced Options > Host JavaScript code on my server. Enabling this option will ensure that the files to be hosted are created when you finish creating the test.
  3. To download the files that you need to host, click Finish. If you have enabled the self-hosting option, the following files appear on the Campaign Created Successfully page:
      • vwo_static.js
      • vwo_test_1.js, where the number denotes the number of test
        Attention: This file is unique for each test you create. You must download the file for every test you want to host on your server.
  4. Before starting the test, upload the files to your server.
  5. Download the same files again and upload them to servers every time you update the test.
ATTENTION The Geo-targeting functionality will not work if you have opted to self-host your test files. Self-hosted files do not interact with VWO servers, and therefore geo-targeting the test will not be possible.

Enabling Self-Hosting Option for an Existing Test

For an existing test, you can enable the option from the View/Edit Test Details section of your test details page. Please note that cross-domain tracking capability is not supported for Website Research – Analyze and Track features.

Hosting JavaScript Files for Multiple Tests on a Single Page

If you are running multiple test on a single page, download the test-specific files (vwo_test_YourCampaignID.js) for each test and upload them to your server. However, you need not upload the common VWO script (vwo_static.js or vwo_no_jquery.js) for each test. One common script will work for all the tests.

ATTENTION Upload the test-specific files (vwo_test_YourCampaignID.js) followed by the common VWO script files (vwo_static.js or vwo_no_jquery.js).

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