How to Add External JS/CSS Libraries

Last updated

The code editor is a powerful tool for users to implement changes on test variations using code. Using the editor, you can edit the variations by directly editing JS/CSS of the webpage and also import custom libraries or a standard library using the quick add option.

  • Adding Custom JavaScript
  • Importing External CSS

  • To add JavaScript code, click the Settings icon next to the variation you want to modify.
  • Select the Edit Code option on the Variation settings pop-up.

Adding Custom JavaScript

  1. To add your own JS library, select JavaScript > Include External JavaScript under Campaign JS/CSS.editor-49
  2. To import custom JavaScript, go to Settings and click Include External JavaScript. Then, type the file path to your custom JS and then click Done.editor-50
  3. To use JavaScript from the standard VWO library, select one from the Quick Add drop-down and then click Done. By default, VWO automatically includes the jQuery adding the custom JavaScript code snippet.editor-51
  4. The JavaScript code snippet for the selected library is included in the variation, as displayed in the following screenshot. Make your modifications to the library and then click Done.

Importing External CSS

  1. To add your custom stylesheet into the variation, select CSS > Include External Stylesheet.editor-52
  2. To import the stylesheet, enter the file path to your custom CSS.
  3. To use a JavaScript snippet from the standard VWO library, select one from the Quick Add list and then click Done.editor-53

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