Some common usage for Campaign or Global JS code in VWO include:
Sending VWO campaign data to analytics tools
Custom conversion goal tracking (using pre-campaign JS)
Define a JS function to capture the variation served to a visitor and then trigger the respective variation of a survey/notification widget
To add campaign-level JS/CSS, click Campaign JS/CSS on the upper-right side of the editor.
This is the default mode when you select the Campaign JS/CSS option. Here, you can define the JS code that you want VWO to execute after the campaign code executes on the page.
To add post-campaign JS, select the variation you want to edit and then click Code on VWO Visual Editor.
NOTE: Post-campaign JS will run only on the URLs which are included under
Settings > URLs section in the test.
To add custom CSS to the website, select CSS > Include External Stylesheet.
Enter the URL to the CSS you want to include. To use some commonly known CSS libraries, select an option from the Quick Add list and then click DONE.
If you wish to build changes on your website by adding components by their custom code, use the Edit code > HTML section of the VWO Editor. You can code from scratch or quickly re-use any website component that is already developed.
To learn more refer to, Adding HTML Using VWO Editor.
Add your pre-campaign JS code on the right panel of the window. On the left panel, enter the global/post-campaign JS code you want to execute after applying changes.
To apply the changes, click DONE.
NOTE: Pre-campaign JS executes on the URLs defined in the test and any
goal URLs included in the test.