I am trying to implement opt-in split testing for a soft launch of new gatsby + shopify site between two branches: “production” and “old-site-redirect”, but it’s not working very consistently. There are times I’m able to switch between branches back-to-back, but there are times where I get locked to one branch. Sometimes I get varying results between browsers, and I made sure to test in incognito/private mode. Also sometimes when the branch does switch, the subpaths will redirect back to other branch.
The domain is sixthreezero-web.netlify.app.
The “production” branch points to the new gatsby site, and “old-site-redirect” points to a branch with a redirect that proxies back to the original Shopify site:
[[redirects]] from = "/*" to = "https://www.sixthreezero.com/:splat" status = 200 force = true
to property is going to point to the original shopify domain at launch.
The split test is set to production = 1%, old-site-redirect = 99%.
I would set it 0 / 100 but the UI removes the branch if it is set to 0%.
I referenced this article to implement opt-in:
I run the following code in the console to test switching branches:
document.cookie = "nf_ab=production; expires=Thu, 06 May 2021 00:00:00 GMT; path=/; SameSite=Strict"; window.location.reload(true);
document.cookie = "nf_ab=old-site-redirect; expires=Thu, 06 May 2021 00:00:00 GMT; path=/; SameSite=Strict"; window.location.reload(true);
I initially tested without the extra cookie options but ended up adding more and more to see what sticks.