{
  "id": 14821645,
  "title": "How to A/B Test Two Landing Pages Using Campaign Links",
  "url": "https://urgent.news/2026/10/16/how-to-a-b-test-two-landing-pages-using-campaign-links",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-16T00:01:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/yutotanaka/how-to-ab-test-two-landing-pages-using-campaign-links-p44"
  },
  "original_language": "en",
  "account": "Setting up an A/B test for two landing pages using a single campaign link involves several key steps. The first step is to create a stable campaign URL that will redirect visitors to one of two landing pages. This URL should remain unchanged throughout the test, as changing it would disrupt attribution and break shared links.\n\nThe redirect endpoint, such as https://example.com/campaign, is responsible for assigning a variant to each visitor and directing them to the appropriate landing page. To ensure consistent assignment, a first-party cookie is used to store the assigned variant once a visitor is directed to a landing page. On subsequent visits, the visitor is consistently routed to the same variant.\n\nThe code provided in the source demonstrates how to implement this setup using a server-side redirect endpoint. The endpoint checks for the presence of the variant cookie, assigns a variant if none exists, and redirects the visitor to the corresponding landing page with the variant as a query parameter. This allows the landing pages to access the variant information and pass it to the analytics tool.\n\nWhen measuring conversions, it is crucial to pass the variant through to the analytics tool. This can be done by reading the variant query parameter on the landing page and sending it as a custom dimension or event property to the analytics tool. This ensures that each conversion is accurately attributed to the correct variant.\n\nCommon pitfalls to avoid include client-side redirects that cause flicker, as assigning the variant with JavaScript after the page loads can result in visitors briefly seeing the wrong page. Server-side or edge redirects should be used to prevent this issue. Additionally, bots can skew the results, so it is important to consider their potential impact on the test.\n\nIn summary, setting up an A/B test for two landing pages using a single campaign link involves creating a stable campaign URL, implementing a server-side redirect endpoint to assign and consistently route visitors to the appropriate variant, passing the variant information through to the landing pages and analytics tool, and avoiding common pitfalls such as client-side redirects and bot interference. By following these steps, you can effectively measure the performance of your landing pages without compromising attribution or user experience.",
  "summary": "You have two landing pages and one campaign link. You want to know which page converts better without sending half your traffic to a page you haven't tested. The usual answer is an A/B test, but the mechanics of routing a single campaign link to two destinations and then measuring the result are less obvious. This article covers a practical setup: a stable campaign URL that redirects visitors to…",
  "key_points": [
    "Create stable campaign URL that redirects to one of two landing pages.",
    "Server-side redirect endpoint assigns and consistently routes visitors to variant.",
    "Pass variant through to landing pages and analytics tool to measure conversions."
  ],
  "editors_take": "Using server-side redirects for A/B testing preserves attribution integrity and prevents visual flickering, ensuring that campaign links remain stable while providing a seamless experience for visitors during landing page experiments.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}