# A/B Testing

> Learn how to tag A/B test page variants in AnyTrack so Landing Page Reports show which variant generates the most revenue, not just the most clicks. Includes the pageVariant JavaScript snippet and setup instructions.

AnyTrack's `pageVariant` command tags each test variation so [Landing Page Reports](/docs/landing-page-report) show which variant generates real `revenue` — not just which one gets more traffic. Compare conversion rates, average order value, and total `revenue` by variant to pick winners based on business outcomes.

> ❗ **Important**
>
> This setup requires adding a JavaScript snippet to each page variant. If you're not comfortable with code, share this guide with your developer.

## Setup

Add the following snippet in the `<body>` of each page variant. The [Tracking Tag](/docs/anytrack-tag) must already be installed in the `<head>` section.

Replace `MY_AB_TEST_PAGE_NAME` with a unique name or ID for the variant:

```javascript
<script>
  AnyTrack("pageVariant", "MY_AB_TEST_PAGE_NAME");
</script>
```

AnyTrack collects the variant name and reports it in the Landing Page Reports alongside all other metrics. Combine this with [Custom Event Triggers](/docs/custom-event-triggers) to track variant-specific interactions, and review winning variants in the [Conversion Report](/docs/conversion-report) to see which version drives the most revenue.

<Image align="center" className="border" border={true} src={readmeAsset1} />

***

<FaqAccordion
  title="FAQ & Troubleshooting"
  items={[
    {
      question: "Where do I see A/B test results?",
      answer: "In the Landing Page Report. Filter or group by page variant to compare conversion rates, revenue, and ROAS across variants."
    },
    {
      question: "Can I test more than two variants?",
      answer: "Yes. Assign a different pageVariant name to each version. AnyTrack tracks all variants and reports them separately."
    },
    {
      question: "Does this work with third-party A/B testing tools?",
      answer: "Yes. As long as each variant loads a page where the Tracking Tag and the pageVariant snippet are present, the data is captured regardless of how the split is managed."
    }
  ]}
/>
