I have a website with share-friendly URLs like example.com/register

I implemented A/B testing as a cookie because I don't want ugly unsharable URLs like example.com/registerA and example.com/registerB.

What is the best practice to see A/B testing in Google Analytics, even though the URL is the same?


1 Answer 1


Google's Content Experiments is meant for separate A/B URLs, but it can be hacked to use the same URL, as described in this article.

The general idea is to:

  • Use the usual Content Experiments wizard,
  • Fill the 2 A/B URL fields with dummy URLs,
  • Insert JavaScript code to modify page content on the client side.

Thanks Eike for the link!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.