To run a test on your website, you’ll need to add the Freshmarketer snippet on your site.
We recommend adding the JS snippet to all the page(s) of your website.
Adding the Freshmarketer snippet to your website is a one-time process and your experiments can be run multiple times provided the code is integrated into that webpage.
To install the Freshmarketer JS snippet on your website, follow these simple steps:
Go to the Dashboard page, click Setup and select Freshmarketer JS code.
The page opens with the Freshmarketer JS code snippet.
Freshmarketer provides two options each of which has a basic functional difference in the code execution.
Synchronous code: The scripts are loaded and executed sequentially.
Asynchronous code: The scripts are loaded and executed concurrently. Since the scripts are executed simultaneously, there is a possibility of page flickering from the original page to the variation page. Hence, avoid using an asynchronous code for A/B testing and split testing Learn more.
Click Copy Code button to copy the JS code snippet. Instead, you can choose to send the code to an email id by clicking Send this code to Developer.
Once you have copied the code, you must paste it into the page(s) of your website. Freshmarketer JS snippet must be integrated into the Head tag of the website’s HTML code.
If the code snippet is placed in the Footer tag, the code still works. But the original page appears first and then immediately changes to the variation page(if any), as the Freshmarketer code kicks-in.
To avoid such potential problems, we recommend you to add the Freshmarketer JS snippet in the early execution path.
Once the code is integrated into your webpage, it does not require modifications every time to run various experiments. Multiple tests can be performed with the same code snippet installed on the webpage, from the same Freshmarketer account.
However, If you need to run experiment from a different Freshmarketer user account, the existing code needs to be removed and replaced with the new code generated from the current account.
STEP 4: Verify Code Integration
Freshmarketer allows you to check the integration of the code snippet by providing the URL of the code-integrated page(s).
In the Tracking Code page, enter the URL of your web page in the Verify URL section.
Click on Verify Installation button to check if your integration is successful.
(click on the image to enlarge)
You can run the necessary test on your website when the tracking code status is successful.
Visitors’ interactions are tracked even when code installation is not verified.