ABTest- determine what a visitor actually gets to see.
Three tags are sufficient for this. ABTest-active() switches on the test area in the first place, ABTest-caseA to ABTest-caseJ enclose the individual variants, and ABTest-TriggerConversion() reports the success back on the target page.
All three tags are permitted in all templates.
Guide: A/B test
The structure in the template
The two area tags always belong nested inside each other. On the outside isABTest-active() with the test ID, on the inside one area for each test case created in the A/B test manager.
Upper and lower case of the tag names and the test ID do not matter.
ABTest-active and abtest-Active lead to the same result. Nevertheless, stick to one spelling, otherwise a later search in the template directory will not find all occurrences.ABTest-active()
The area is displayed if the A/B test with the specified ID is currently active. The test ID is passed as a parameter and must match the ID from the A/B test manager exactly.How the test case is assigned
The shop does not assign the test case randomly. When the test is first called in a session, it determines which test case has had the fewest views so far and assigns that one. This distributes visitors evenly across the variants, without one variant ending up with significantly less data than the other. Counting is done per subshop. A test running in several subshops therefore balances its distribution in each subshop separately.The view is only counted by the positive area
{ABTest-active(…)}, not by the negative one. A template that works exclusively with {!ABTest-active(…)} therefore delivers no data to the test.ABTest-caseA to ABTest-caseJ
The area is displayed if the corresponding test case is assigned to this visitor. For each test case created in the A/B test manager, a separate area belongs in the template, fromABTest-caseA up to a maximum of ABTest-caseJ. More than ten test cases are not possible.
The letter in the tag corresponds to the order of the test cases in the A/B test manager: the first test case is A, the second B, and so on. It is independent of how you named the test case there. If a test case is deleted in the manager, the test cases behind it move up by one letter. In this case, check the assignment in the template, otherwise variant B will suddenly show the content of C.
ABTest-TriggerConversion()
Counts a conversion for the test with the specified ID. The tag belongs on the page whose call is counted as a success.The tag is only needed if “By tag on target page” has been set as the conversion goal in the A/B test manager. For the other goals, the shop counts itself, and the tag then has no effect.
Viewing variants specifically
In test mode, you can call up each test case yourself instead of waiting for the shop to assign it. To do this, the shop is called with three parameters:
With
ab-test-id=off you end the A/B test mode again without leaving the general test mode.
Calls in test mode are not included in the evaluation. Neither views nor conversions are counted, so you can switch between the variants as often as you like.
Unlike in live operation, test mode only checks whether the test has been created, not whether it is currently running. You can therefore view variants before the start and after the end of a test.
Related topics
- Guide: A/B test
- Guide: Enabling and disabling shop test modes
