An AB test it’s a comparison between two versions of the same page (this testing method is often used in online marketing). With this type of test you can measure what version of a page produces more conversions.
Google Analytics has a powerful tool for AB testing. This tool does all parts of AB testing, including visit balancing over versions of pages (distributes visits to each page version), data registering, reporting and decision.For doing an AB test with Google Analytics you need to do the following steps:
1. Build an alternative page for your original page (page you want to test it)
2. Registering this experiment in Google Analytics section Content/Experiment
3. Put the code of experiment only in the original version of page.
You can find more details here: https://support.google.com/analytics/answer/1745147?ref_topic=1745207&rd=1