A/B Testing
A/B testing is a controlled experiment in which two variants of a page or an element are shown to different user groups at the same time in order to measure which version performs better against a defined metric. A test only becomes meaningful once sample size and runtime have been fixed in advance and adhered to. A statistically significant result means only that the observed difference would rarely arise under the assumption that there is no difference – it is neither proof that one variant is better, nor does it say anything about whether the difference matters commercially.
In practice
In practice, only one element is usually changed at first, a call-to-action button or the arrangement of product images for example, so that the effect remains clearly attributable. Visitors are assigned to variant A or B at random, controlled by a testing tool or your own scripts, while GA4 or a separate analytics tool measures the target metric. The most common mistake is not stopping early as such, but watching the results as they come in and stopping the moment significance first appears ("peeking"). Do that and you will find winners that are not winners: the rate of false positive results rises far above the assumed five per cent. So fix sample size and runtime before the start, test over whole weekly cycles, and remember that with several variants or target metrics every additional comparison raises the chance of a fluke.