Add VWO SmartCode to Your Website

Last updated

VWO SmartCode is a small JavaScript code snippet that you add to your website to start using VWO. The code snippet contains a unique Test ID and allows your website to interact with VWO servers. To learn more about VWO SmartCode, click here.

How to Access VWO SmartCode

To access your VWO SmartCode, sign in to your VWO account and click the settings icon located in the upper-right corner. Next, click the SmartCode tab on the Settings page.

how-to-add-smart-code

Where to Add SmartCode on a Webpage?

You should add the code snippet to all the pages of your website. If the website uses template-based headers and footers, put the code snippet in the header or footer to implement it across the website.

In the HTML code of your website, look for the <head> tag. Copy the VWO code snippet and paste it anywhere between the <head></head> tags of the page.

add-code

Adding the code snippet in the header of a webpage helps execute the code faster and doesn’t slow down the rest of your page from loading.

How to Add VWO Smart Code?

There are two ways to add VWO SmartCode: manual and automatic.

For adding the VWO code snippet automatically, VWO provides third-party integrations. You can add the VWO code by installing VWO plug-ins for some third-party platforms. To learn more on how to integrate VWO with a third-party platform, click here.

Adding VWO SmartCode Manually

Follow these steps to add VWO SmartCode manually to your test webpages:

  1. Click the Settings icon in the upper-right corner of the dashboard. how-to-add-smart-code-1
  2. On the Settings screen, click SmartCodesmart-code-2VWO provides two different types of code snippets:
    • Asynchronous code: Reduces the page load time, as SmartCode is downloaded in parallel with the site code. It also ensures that your site loads normally even if the VWO servers are inaccessible.
      ATTENTION Do NOT use Asynchronous code if you are running a Split URL test on the website with exit pop-ups. Asynchronous code executes in parallel with your website code, so users might see an exit pop-up on redirection rather than seeing a variation.
    • Synchronous code: Executes line by line, one line at a time, and is more likely to slow down the website.
  3. Select and copy Smart Code.
  4. If you need to consult a technician to add code to your website, click Send to Developer to email the code snippet.
  5. Sign in to your website admin panel and paste the SmartCode snippet between the <head> and </head> tags of the page.
ATTENTION You should not install VWO code through tag managers such as Google Tag Manager. By default, all tag managers load VWO code asynchronously, which may cause page flicker on the test pages. Also, using tag managers may lead to delayed loading of VWO code, which can cause time-out issues and prevent visitors from becoming part of the test.

After you add the code to your website, the code does not change for any test. Now, with the code in place, create as many website optimization tests as you want.

Contact Us / Login

Product
Resources Home