Link Code Generator Logo
Link Code Generator

Free A/B Split Testing Script Generator

Split landing page traffic between two URLs for A/B testing without plugins or paid tools. Copy and paste the generated JavaScript snippet.

Version A (Control)

50%

Version B (Variant)

50%
% to Version A50/50% to Version B
Help & Guides

What Is an A/B Split Test?

An A/B split test sends a percentage of your visitors to a "Control" page (Version A) and the remaining percentage to a "Variant" page (Version B). By measuring which page generates more conversions — signups, purchases, clicks — you get data-driven evidence of which design or copy approach works better. It eliminates guesswork and replaces it with real performance data.

How This Tool Generates the Split

This tool generates a lightweight client-side JavaScript snippet using Math.random(). When a visitor lands on the entry page (where you paste the snippet), the script instantly generates a number between 0–100 and routes them to Version A or Version B based on the split percentage you defined. The redirect happens before any visual content loads — the experience is seamless.

This approach is zero-cost, zero-infrastructure, and requires no third-party split testing subscription. Pair it with UTM parameters on each variant URL to measure results in Google Analytics.

How to Run Your A/B Test

  1. Create two versions of your landing page — Version A (your current "control") and Version B (your variant with one change).
  2. Enter both URLs and set your split percentage. A 50/50 split is standard for most tests.
  3. Add UTM parameters to each URL (e.g. ?utm_content=version-a and ?utm_content=version-b) so Google Analytics can track which version converts.
  4. Copy the generated snippet and paste it into the <head> of your entry page.
  5. Drive traffic to the entry page (paid ads, email, social), and monitor conversions by the UTM content tag in Google Analytics or your preferred analytics tool.

What Should You Test?

  • Headlines: The most impactful element on any landing page. Small headline wording changes regularly produce 20-50% conversion uplifts.
  • CTA Button Copy: "Get Started" vs. "Start Free Trial" vs. "Claim Your Spot" — each creates a different intent signal.
  • Hero Image or Video: Test whether a product image or an explainer video performs better above the fold.
  • Pricing Display: Monthly vs. annual pricing, showing vs. hiding the price comparison.
  • Social Proof Placement: Test testimonials above the fold vs. below the CTA.

Frequently Asked Questions

How long should I run an A/B test?

Run your test until you reach statistical significance — typically at least 100 conversions per variant. For low-traffic pages, this may take several weeks. Ending a test too early (peeking) inflates false positive rates. Use a significance calculator once you have sufficient data.

Should I change multiple elements at once?

No. Only change one element per test. Changing the headline, CTA, and hero image simultaneously makes it impossible to know which change drove the result. For testing multiple elements simultaneously, use a multivariate test instead.

Is this a 50/50 split only?

No. You can set any percentage split. However, 50/50 is recommended for most A/B tests as it reaches statistical significance fastest with equal exposure. Use an unequal split (e.g. 80/20) if you want a "safer" test where most traffic still goes to the known control.

Get smarter about link tracking

UTM strategies, campaign tricks, and new tools for marketers who want cleaner data.

All Tools Directory

Every free tool, in one place. Perfect for anyone who needs to create QR codes, build UTM-tagged links, generate contact links, or manage campaign URLs. No account required.

Amazon Affiliate Link Builder

Clean up messy Amazon URLs and generate perfect Associate links using your affiliate tag.

Link Expirator & Countdown Snippet

Generate a Javascript snippet to automatically expire a link and redirect traffic after a specific date and time.

Link Cloaker & Redirect

Generate HTML, PHP, and .htaccess redirect codes to hide ugly affiliate links.

Link Rotator

Generate a JavaScript snippet to randomly rotate traffic across multiple destination URLs based on percentage weights.

A/B Split Tester

Generate a Javascript snippet to split landing page traffic between two URLs for A/B testing.

URL Shortener

Instantly shorten long URLs to display clean links on social media.

UTM Link Builder

Easily add UTM parameters to URLs so you can track Custom Campaigns in Google Analytics.

SMS Link Generator

Create clickable sms: links that open the native text message app with a phone number and pre-filled message. Generates the URL and HTML code.

Mailto Link

Create advanced email links with pre-filled subjects, CC, BCC, and body text. Generates standard URLs and HTML code.

Direct Review Link

Generate direct 5-star review links for Google My Business, Yelp, Facebook, and Trustpilot to send to your customers.

Social Share Link

Create 1-click sharing links for Twitter, Facebook, LinkedIn, Reddit, and more. Generate custom URLs and HTML buttons.

Telegram Link

Create direct Telegram links using a username or phone number. Generates t.me URLs and HTML code.

WhatsApp Link

Create click-to-chat WhatsApp links with pre-filled messages. Generates wa.me URLs and HTML code.

Barcode (1D)

Generate, preview, and download 1D barcodes (Code128, EAN-13, UPC, etc.) instantly in your browser.

GA4 Cross-Domain Tracker

Generate Google Analytics 4 (GA4) cross-domain tracking code snippets to maintain user sessions across multiple websites.

Smart App Deep Link

Generate smart routing scripts that detect the user OS and redirect to native mobile apps falling back to web URLs.

HTML Link

Generate clean, perfectly formatted HTML anchor tags with custom rel, target, class, and ID attributes.

Open Graph Meta Tag

Generate the perfect Open Graph and Twitter Card HTML meta tags for social media link sharing optimization.

Payment URL

Generate unified deep links to accept payments via PayPal, Venmo, and Cash App.

QR Code Generator

Create custom QR codes with colors, logos, and multiple export formats.

WiFi QR Code

Create a WiFi QR code for your home or business. Guests scan to connect instantly — no password typing needed.

vCard QR Code

Create a vCard QR code for your business cards. Seamlessly share contact info straight to their phone book.

Social Media QR Code

Generate a QR code linked to your Instagram, Twitter, or TikTok.

Payment QR Code

Generate a payment QR code for Venmo, PayPal, or Stripe.

Event QR Code

Generate an iCalendar Event QR code for your invitations.

Location QR Code

Generate a QR code for a physical location mapping.

Email QR Code

Generate a mailto QR code.

Phone Call QR Code

Generate a phone call QR code.

SMS QR Code

Generate an SMS text message QR code.

App Store QR Code

Generate a QR code to link to your app on the App Store or Google Play.

Universal Location & Maps Link

Generate universal smart routing scripts and direct deep links for Google Maps, Apple Maps, and Waze.