Free Tool

A/B test generator

Run an A/B test on your landing pages without a paid testing tool. Enter your page URLs and the split you want (50/50, 80/20, any mix) and get one small file to upload to your site. Visitors stay on their variant, your UTMs survive, and each variant is tagged for analytics.

Used for the file and cookie name. Give each test its own name.

Variants

Quick split:

Options

offer-test.php


      

    How to use it

    1. Download the file and upload it to your site, e.g. yoursite.com/go/offer-test.php
    2. Use that URL as the link in your ads or emails, with your usual UTM tags.
    3. Preview each variant by adding ?force=A or ?force=B.
    4. When you have results, check them in the A/B significance calculator.

    How to run an A/B test on your landing pages

    This kind of A/B test (also called a split URL or redirect test) compares two or more complete landing pages at different addresses. It's the simplest way to test a whole new page against your current one, and unlike A/B testing tools that swap content with JavaScript, there's no flicker and nothing slowing the page down.

    Why the script works the way it does

    • Sticky visitors. A cookie keeps each person on the same variant when they come back, otherwise returning visitors get counted in both groups and your results get muddied.
    • 302, not 301. A temporary redirect tells search engines the test is temporary, so they keep your original pages indexed. Google recommends this for A/B tests.
    • No caching. The script tells browsers and CDNs not to cache the redirect, so every new visitor gets a fresh random assignment.
    • Attribution intact. UTM tags and ad click IDs (gclid, fbclid) are passed through, so conversions are still credited to the right campaign.

    A/B testing tips for a fair result

    • Change one big thing. A new headline and offer angle, or a new layout. Testing lots of small tweaks at once makes the result hard to learn from.
    • Work out your sample size first with the A/B test calculator, and run for at least a full week to cover weekday and weekend behaviour.
    • Uneven splits are fine. An 80/20 split limits the risk of an untested page, but it takes longer to reach a confident result.
    • Don't change the split mid-test. Visitors who already have a cookie keep their variant; changing weights only affects new visitors and skews the comparison. Start a new test (with a new name) instead.

    FAQ

    A/B testing questions

    Can't find what you need? Ask us directly.

    How do I set up an A/B test for two landing pages?
    Enter the URL of each page and the split you want, then download the script and upload it to your site. Send all your ad or email traffic to the script's URL: it randomly sends each visitor to page A or page B according to your split, and remembers their variant in a cookie so they see the same page if they come back. Then compare conversions for each variant.
    Is this a free alternative to A/B testing tools?
    For testing whole landing pages against each other, yes. Paid A/B testing tools add visual editors and reporting, but a split URL test like this needs nothing more than one small PHP file on your own site. You measure results in the analytics you already use, and check the winner with our free A/B test significance calculator.
    Will an A/B test hurt my SEO?
    Not when it's done this way. The script uses a temporary (302) redirect and a noindex header, which is what Google recommends for A/B tests, so search engines keep indexing your original pages. Use the script URL for ads and campaigns, not as a page you want ranked.
    How do I see which variant wins?
    The script adds ?variant=A or ?variant=B to the destination URL. In GA4 you can compare conversions by page location or create a custom dimension from the variant parameter; in Google Ads and Meta the landing page report shows it too. When you have the numbers, check them with our A/B test significance calculator.
    Do my UTM tags and click IDs survive the redirect?
    Yes. With "pass query string through" on (the default), everything after the ? in the script URL, such as utm_source, gclid and fbclid, is passed to the destination page, so your attribution keeps working.
    What do I need to run it?
    Any web host that runs PHP 7.3 or newer, which is nearly all of them. Upload the file (for example to yoursite.com/go/offer.php) and use that URL as the link in your ads. No database or plugin is needed.
    How do I preview each variant?
    Add ?force=B (or A, C, D) to the script URL. You'll go straight to that variant, and your own cookie isn't changed, so you don't skew the test.

    Want us to run your landing page tests?

    We design the variants, run the traffic and tell you what won, and why. Testing is part of every landing page we build.

    Talk to us