Link Code Generator Logo
Link Code Generator

Free Link Rotator Script Generator

Randomly rotate traffic across multiple destination URLs based on percentage weights. Get a ready-to-paste JavaScript snippet in seconds.

Rotation Settings

URLs to Rotate

Total: 100%
Help & Guides

What Is a Link Rotator?

A link rotator is a script that distributes incoming traffic across multiple destination URLs based on defined percentage weights. Instead of sending 100% of your visitors to one page, you can send 60% to Offer A, 30% to Offer B, and 10% to Offer C — all from the same entry point URL.

Unlike enterprise split-testing platforms that charge monthly fees, this tool generates a lightweight JavaScript snippet that runs entirely in the visitor's browser — no server required, no monthly cost, no tracking dashboard login.

How It Works

Paste the generated snippet into the <head> of your entry page HTML. When a visitor lands on the page, the script generates a random decimal number between 0 and 1, then checks it against the cumulative weight thresholds you defined. The browser is immediately redirected before any visible content renders — the experience is seamless.

Best Use Cases for a Link Rotator

  • Affiliate Marketing Split Testing: Rotate traffic across competing offers to discover which converts best before committing your full media budget.
  • Multi-Offer Campaigns: Run multiple affiliate offer variants simultaneously, distributing traffic proportionally based on commission rates or EPC performance.
  • Geographic or Demographic Segmentation: Combine with country-based redirect logic to send specific segments to tailored landing pages.
  • Load Balancing: Spread visitors evenly across multiple hosted versions of a high-traffic page to distribute server load.
  • Offer Fallback Chains: Send the majority to your primary offer but redirect a small percentage to a backup offer in case the primary goes out of stock or pauses.

Percentage Weights Must Total 100%

The combined percentages of all URLs must add up to exactly 100% for the rotator to work correctly. The tool validates this for you and shows an error if the weights do not balance. Adjust sliders until the total reads "100%" in green before generating the snippet.

Frequently Asked Questions

Is the traffic distribution exactly random?

Yes, but probabilistically. The script uses Math.random() which is pseudo-random, meaning the distribution will approach your defined percentages over a large volume of visits but may deviate slightly on smaller sample sizes. Over thousands of visits, the split will be statistically accurate.

Can I track where each visitor went?

Not automatically with this snippet. To track conversions per variant, add UTM parameters to each destination URL before entering them here. Your analytics platform (Google Analytics, etc.) will then attribute conversions by UTM campaign/content tags correctly.

How many URLs can I rotate between?

This tool supports up to 5 destination URLs. For more complex rotations, the generated snippet code can be manually extended by duplicating the weight-check logic for additional URLs.

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.