Comment on page

Split URL Testing

  • Create an experience
  • Add the page path for which you will be performing the split URL testing
  • Create a behavior
  • Click on the visual editor
  • Select on any element and then click on parent until you reach the body of the webpage
  • Then in the popup scroll down and you will find an option of on load
  • Click on it and select the execute JS option
  • Paste the below code
try {
var ele = document.getElementById('customfitinit')
ele.insertAdjacentHTML("beforebegin", `<style type="text/css">.customfit-redurl-invisible-block{visibility:hidden !important; opacity:0 !important}</style>`)
var html_ele = document.querySelector("html")
if(html_ele.classList)
html_ele.classList.add("customfit-redurl-invisible-block");
else if(html_ele.className)
html_ele.className = html_ele.className + " customfit-redurl-invisible-block";
window.customFit.sharedPreferences.splitTestActivated = true;
window.location.href = 'https://test.customfit.ai/how-it-works';
} catch(e) {console.log(e)}
  • In the above code replace the URL 'https://test.customfit.ai/how-it-works' to your website page URL to which you want the customer to be redirected and then save
  • Click on Finalize & Exit button
  • Perform the same steps for other behavior also
  • Then at last in the default rollout section divide the traffic accordingly.
Reference loom video: