abconvert, the client your stack guide creates on the server, and useABConvert() in a component.
Read an assignment
Use this to keep your storefront consistent with a test. To render a different version of a page per test group, see Feature tests (coming soon). Read it on the server, or in the browser in a component. Both use the same method.'49603' is the test ID shown in the ABConvert admin. getAssignment returns null when the visitor is not in the test. getAssignments() returns every assignment for the visitor.
Send test groups to another tool
PassonAssignment to the provider. It runs in the browser once the visitor allows analytics: once for each test they are in, on every page load.
Browser (provider)
abconvert:assignment-ready event on window, at the same moment. It is the event ABConvert fires on a theme. A tag manager trigger built on it keeps working. See Events.
Neither runs for a forced or preview assignment.
Common mistakes
- Using
testGroup.nameas an identifier. The name is a display label that can change while the test runs. The fix: sendtestGroup.indexto other tools and branch ontestGroup.controlin your code.