Skip to main content
SendURL, home
Link trackingBy SaraUpdated First published 17 min read

A/B Test Short Links: Split One Link, Read the Result

Part of the Link tracking handbook

A/B test a short link: split one link's visitors between two pages, keep each visitor on one of them, read the result, and check the gap with a significance test you can run in Python or JavaScript.

To A/B test short links, turn on an A/B test on one link: it splits the link's visitors between two or more destinations by weight, keeps each visitor on the same one, and records which variant each click got. A/B tests are Pro and above: any number of tests, up to four variants and any split. Then check whether the difference between the pages is bigger than chance.

One link, two pages: the split happens at the redirect.

That built-in test compares two pages behind one message. To compare two messages (a subject line, a button, a caption, a poster), give each variant its own short link and split the audience yourself; that manual method is the second half of this guide and works on every plan. This guide is part of the link tracking handbook.

Run the test on one link. A SendURL link can split its visitors between two to four destinations, called variants, so the message, the slug and the QR code stay the same and only the page changes.

  1. Open the test editor. On the console's New link form, choose the A/B test option; on an existing link, use the A/B test card on the link's page.
  2. Add the variants. Each variant is a destination URL and a weight, a whole percentage, and the weights add up to 100. A new test starts at 50/50.
  3. Tag each variant's URL with utm_content=a and utm_content=b if the pages use GA4, so the two groups can be told apart on the site.
  4. Save, and share the one short link as you would any other. Each visitor is sent to one variant by weight and gets the same one on later visits (the link remembers the choice with a cookie). Scans of the link's QR code are split the same way.
  5. Read the A/B test results card on the link's page: clicks and share for each variant, the change against the previous period and a "Leading" tag. Unique visitors per variant are Pro and above.
  6. Pick winner when the test has run its course. That sets the link's destination to the winning variant's URL and ends the test. You can also end a test without a winner, which leaves the destination as it was.

What each plan allows, as of 14 November 2026:

Free and StarterPro and above
Links with a running testNoneUnlimited
Variants per testNoneUp to 4
The splitNoneAny split, any destinations
Pick winnerNoneAny variant; a different winner changes the destination

The other Pro link controls work on a test link too, such as a password: see password-protected short links.

What the results can't tell you

SendURL records clicks, not conversions. The clicks per variant will sit close to the weights you set, because the link itself deals visitors out by those weights; they say the split worked, not which page is better. Small gaps between the counts and the weights are normal, and why A/B test counts are uneven explains where they come from. Which page converts better has to come from the pages: compare conversions for utm_content=a and utm_content=b in GA4, then check the gap with the significance test below.

Three more things to know before you start. Link-preview fetchers and other known bots are sent to the link's own destination, not dealt into a variant. On a password-protected link the variant is chosen after the right password. And a visitor on a phone that matches one of the link's Deep links goes to the app address, not into the test; the full order is in short link routing precedence.

Write the plan down before the first visitor arrives: the A/B test brief template has the fields.

The built-in A/B test is Pro and above (limits by plan: link A/B testing). The manual method below (one short link per variant) works on any plan with no limit beyond the 25 links Free holds.

Built-in tests, three or four variants, a split such as 90/10 in favour of the new page, and unique visitors per variant are Pro and above; Pricing lists every plan.

Clicks happen before the page loads, so they measure the message that carried the link. The page behind it needs its own test.

TestVariant AVariant BHow to splitDivide clicks by
Email subject line"Autumn sale ends Sunday""30% off until Sunday"Your email tool's random 50/50 splitEmails delivered to each half
Email button text"Shop the sale""See what's 30% off"Random halves of one listEmails delivered to each half
Two SMS wordingsShort, with offer firstLonger, with product nameRandom halves of the listMessages delivered
Two postersDesign ADesign BSwap the designs between two sites halfway throughDays on display (a weak denominator)
Two social captionsCaption ACaption BTwo posts at comparable timesThe platform's impressions for each post
Two landing pagesPage APage BOne link with a built-in A/B test (above), or random halves with a link eachNot clicks: compare conversions on the pages

The first three are clean tests: a random split of one list gives both sides the same audience. The poster and social tests are weaker, because place and time differ between the variants. Run them anyway, but repeat them before you trust them.

For landing pages, clicks will be roughly equal by design (the message is the same). Tag each destination with utm_content=a or utm_content=b and compare conversions in GA4; see the UTM parameters guide.

For a test of two messages, the split has to happen where the message is sent, so each variant gets its own link. Two links, identical except for the slug and, if you use GA4, utm_content:

VariantShort linkDestination
Asnu.to/2026-10-autumn-ahttps://example.com/autumn-sale?utm_source=newsletter&utm_medium=email&utm_campaign=2026-10-autumn-sale&utm_content=a
Bsnu.to/2026-10-autumn-bhttps://example.com/autumn-sale?utm_source=newsletter&utm_medium=email&utm_campaign=2026-10-autumn-sale&utm_content=b

Slugs on snu.to are shared by all SendURL users, so a dated prefix keeps them yours. Creating both through the API:

Create variant links A and BShell
for v in a b; do
  curl -s -X POST https://api.sendurl.to/api/v1/links \
    -H "Authorization: Bearer $SENDURL_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"destinationUrl\": \"https://example.com/autumn-sale?utm_source=newsletter&utm_medium=email&utm_campaign=2026-10-autumn-sale&utm_content=$v\", \"slug\": \"2026-10-autumn-$v\", \"title\": \"Autumn test: variant $v\"}"
  echo
done

Change the slugs before you run it: once a slug exists, a second create with it is a 409 slug_taken. Note each response's id; you'll need it to read the clicks.

How many clicks do I need for an A/B test?

It depends on your usual rate and the smallest difference you care about: at a 2% click rate, a half-point lift takes about 13,800 recipients per variant and a full point about 3,800. Decide before sending how small a difference you care about, then work out the audience it takes to see it. The A/B test calculator does this without code: under Plan a test, enter your usual click rate and the lift you want to detect. The standard formula for two proportions, per variant:

Text
n = (z_alpha/2 + z_beta)^2 × (p1 × (1 − p1) + p2 × (1 − p2)) / (p1 − p2)^2

p1 is your usual click rate, p2 the rate you hope to reach, and the z values come from your confidence level (1.96 for 95%) and power (0.84 for 80%). In Python:

sample_size.pyPython
import math
from statistics import NormalDist

def per_variant(p1, p2, alpha=0.05, power=0.8):
    """Recipients needed per variant to detect p1 -> p2 (two-sided test)."""
    z = NormalDist().inv_cdf
    spread = p1 * (1 - p1) + p2 * (1 - p2)
    return math.ceil((z(1 - alpha / 2) + z(power)) ** 2 * spread / (p1 - p2) ** 2)

print(per_variant(0.02, 0.025))  # 13807
print(per_variant(0.02, 0.03))   # 3823
Worked from the formula above, for a 2% baseline.

With a 2% click rate, spotting a half-point lift takes about 13,800 recipients per side; a full point takes about 3,800. If your list has 5,000 people, test bold changes, not commas. (The 2% is an example rate for the arithmetic, not a benchmark; use your own past campaigns.)

You will meet rules of thumb such as "a few hundred clicks per variant" or "500 clicks per variant" on other shorteners' blogs (two of them read on 15 November 2026). No single count can be right, because the answer moves with your baseline. The same formula gives about 3,800 recipients per variant both for 2% against 3% and for 10% against 12% (per_variant(0.10, 0.12) returns 3839): roughly 76 to 115 clicks per variant in the first case, and 384 to 461 in the second.

Is the difference real?

Once the test has run its course, compare the two click rates with a two-proportion z-test. To check one result by hand, enter the four numbers into the A/B test significance calculator; the code below does the same for a script or a sheet. The example numbers are made up for illustration: 4,000 emails per variant, 92 clicks on A and 121 on B.

ab_test.pyPython
from math import sqrt
from statistics import NormalDist

def two_proportion_test(clicks_a, sent_a, clicks_b, sent_b):
    p_a, p_b = clicks_a / sent_a, clicks_b / sent_b
    pooled = (clicks_a + clicks_b) / (sent_a + sent_b)
    se = sqrt(pooled * (1 - pooled) * (1 / sent_a + 1 / sent_b))
    z = (p_b - p_a) / se
    p_value = 2 * (1 - NormalDist().cdf(abs(z)))
    return p_a, p_b, z, p_value

p_a, p_b, z, p = two_proportion_test(92, 4000, 121, 4000)
print(f"A {p_a:.2%}  B {p_b:.2%}  z={z:.2f}  p={p:.3f}")
# A 2.30%  B 3.02%  z=2.01  p=0.044

A p-value under 0.05 means a gap this large would turn up by chance less than 1 time in 20 if the variants were really the same. Here it is just under, so B probably wins, and it is worth repeating before you rewrite every email. The same test in JavaScript (Node or a browser console):

abTest.jsJavaScript
// Normal CDF via Abramowitz and Stegun 7.1.26 (error below 1.5e-7).
function normalCdf(x) {
  const t = 1 / (1 + (0.3275911 * Math.abs(x)) / Math.SQRT2);
  const poly = ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t;
  const erf = 1 - poly * Math.exp(-(x * x) / 2);
  return x >= 0 ? (1 + erf) / 2 : (1 - erf) / 2;
}

function twoProportionTest(clicksA, sentA, clicksB, sentB) {
  const pA = clicksA / sentA;
  const pB = clicksB / sentB;
  const pooled = (clicksA + clicksB) / (sentA + sentB);
  const se = Math.sqrt(pooled * (1 - pooled) * (1 / sentA + 1 / sentB));
  const z = (pB - pA) / se;
  return { pA, pB, z, pValue: 2 * (1 - normalCdf(Math.abs(z))) };
}

console.log(twoProportionTest(92, 4000, 121, 4000));
// { pA: 0.023, pB: 0.03025, z: 2.01…, pValue: 0.044… }

Count people, not clicks

The test assumes each recipient either clicked or didn't. SendURL counts every click, including repeats and link previews and email scanners, and it has no unique-click count. Before testing, clean the numbers: drop automated clicks. Repeats by one person still count; on Starter and above, each link's Unique visitors on the Analytics page (an approximate count of distinct visitors that still includes automated visits) is the estimate of people. This script does the cleaning for each variant (install requests first with pip install requests):

variant_clicks.pyPython
import os, re, time

import requests

API = "https://api.sendurl.to/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SENDURL_API_KEY']}"}
BOT_UA = re.compile(r"Slackbot|facebookexternalhit|Twitterbot|bot/|crawler|spider|curl/|python-requests", re.I)

def human_clicks(link_id):
    """Clicks that don't look automated (repeats by one person still count)."""
    count, params = 0, {"limit": 10}
    while True:
        r = requests.get(f"{API}/links/{link_id}/clicks", headers=HEADERS, params=params, timeout=10)
        r.raise_for_status()
        page = r.json()
        for c in page["clicks"]:
            ua = c["userAgent"] or ""
            if ua and c["browser"] and not BOT_UA.search(ua):
                count += 1
        if not page["pagination"]["hasMore"]:
            return count
        params["cursor"] = page["pagination"]["nextCursor"]
        time.sleep(0.25)  # stay under the API's rate limit

for name in ("LINK_A", "LINK_B"):
    print(name, human_clicks(os.environ[name]))

Feed those counts (or the Unique visitors figures) into two_proportion_test with the number of emails delivered to each half. If your email tool reports unique human clickers per variant, use its numbers as a cross-check.

Testing more than two variants

Paid plans allow up to four variants on one link, and the manual method takes as many links as you make. More variants cost you in two ways.

Each variant gets a smaller share. The sample size above is per variant. Four variants at a 2% click rate, looking for a full-point lift, need about 3,800 recipients each: roughly 15,300 in total, where two variants need about 7,600.

More comparisons mean more false winners. Test three challengers against the original at the usual 5% threshold, and the chance that at least one looks like a winner by luck alone is about 14% (1 − 0.95³). The simple fix is to divide the threshold by the number of comparisons: with three, call a result significant only when its p-value is under 0.017, which brings the overall chance back to about 5%.

So test two variants unless you have the audience for more, and when a third variant wins narrowly, run it again against the original alone before you believe it.

Run an A/A test first

Before your first real test, send the same message to both halves through two links. The two rates should come out close, and the test should say "no difference" (a p-value above 0.05) about 19 times in 20. If it flags a winner, look for the cause before trusting any A/B result: an uneven split, one half going out hours later, or bots hitting one link more.

When to stop

Pick the end before you start: a sample size from the formula above, or a fixed period such as seven days after the send. Then don't call the result early because it looks good on day two. Evan Miller's How Not To Run an A/B Test (2010) explains why: "Repeated significance testing always increases the rate of false positives."

To watch the test without deciding on it, read daily counts per variant with GET /links/:id/stats (daily counts are in the API docs):

Daily clicks for one variantShell
curl "https://api.sendurl.to/api/v1/links/$LINK_A/stats" \
  -H "Authorization: Bearer $SENDURL_API_KEY"

The response is a list of { "date": "2026-10-14", "count": 9 } rows in UTC, days without clicks left out.

Results template

ab-test-log.txtText
Test:            2026-10 autumn sale, button text
Hypothesis:      "See what's 30% off" gets more clicks than "Shop the sale"
Audience:        newsletter list, random 50/50 split in the email tool
Links:           snu.to/2026-10-autumn-a (A), snu.to/2026-10-autumn-b (B)
Planned size:    3,823 per variant (2.0% -> 3.0%, 95% confidence, 80% power)
Sent:            2026-10-14 09:00 UTC, both halves together
Ends:            2026-10-21 09:00 UTC
Delivered:       A 4,000 | B 4,000
Clicked:         A __ | B __   (automated removed; or Unique visitors, Starter and above)
Result:          z = __, p = __
Decision:        __
Repeat on:       __

Checklist: run the test

  • One question per test, written down before sending
  • Testing two pages: one link with an A/B test, each variant's URL tagged with utm_content
  • Testing two messages: one short link per variant, same destination
  • A random split of one audience, sent at the same time
  • Sample size or end date fixed in advance
  • An A/A test run once on this channel
  • Automated clicks removed and repeats deduplicated before testing
  • Two-proportion test on people and audience size, not raw clicks alone
  • Results logged, including the tests that found nothing

For turning clicks into a rate in the first place, see how to measure click-through rate. To compare posting times rather than messages, use your best time to post from click data.

Start a test on any link in the console on Pro and above.

Frequently asked questions

  • Yes. A SendURL link can run an A/B test: it splits visitors between destinations by weight, keeps each visitor on the same one, and records which variant each click got. A/B tests are on Pro and above: any number of tests with up to four variants and any split. Compare what happens on the pages, usually with utm_content in GA4.

See where your clicks come from.

Every short link tracks clicks by country, device, browser and referrer, on the Free plan too. No credit card, no sign-up to start.

Keep reading

More: how-to answers, all link tracking guides and the SendURL blog.