How do I install the code snippet?
To implement changes and track the data, you will need to install the snippet to the experiment pages on your website.
Adding the snippet to your website is a one-time process per project. The code automatically updates for any changes you make in the experiment. All your experiments under one project can be run multiple times, provided the code is installed on all the experiment webpages.
Step 1: Go to the Snippet page by clicking the Snippet icon in the top pane.
Step 2: Copy the code snippet shown.
Step 3: Paste the code snippet into the page(s) of your website. The snippet must be pasted at the start of the <head> tag of the webpage’s HTML code.
NOTE: Once the code is installed on your webpage, it does not require modifications every time to run various experiments. Multiple experiments can be performed with the same code snippet installed in the webpage, for all experiments on the project level.
You can verify if the code snippet is installed on your webpage successfully by entering the experiment URL in the Verify Your URL section of the Snippet page.
If a URL installation error appears, check if you have:
- Pasted the code in the indicated section of your webpage's HTML code.
- Made any accidental typographical mistakes in the code snippet.
If the error persists, delete the code snippet and try again.
Asynchronous Code Snippet:
An asynchronous code loads in parallel to your webpage and does not affect the loading time of your website. This type of code has a timer set for the pages to load and if a page fails to load within the set time, it stops execution and the original website version is displayed instead.
Using an asynchronous code snippet in A/B tests and Split URL tests can cause a "flicker" on the page when the original loads, followed immediately by the variation.
Synchronous Code Snippet:
A synchronous code snippet executes each function or statement in HTML code one after the other, following the tag. If the synchronous code snippet fails to execute, it will block any further execution of the code.
We recommend that you use the synchronous code snippet when you're conducting an A/B test or a Split URL test. Using a synchronous code snippet has a negligible effect on the page's load time.
By default, you can choose to install the synchronous code snippet on your website.