AdShuffle - Demo

A JavaScript package for random banner rotation with frequency and date control.

View on GitHub

About AdShuffle

AdShuffle allows you to manage banner rotation based on frequency and date range settings. You can also enable automatic rotation with a set interval. Below are examples showcasing different cases and configurations.

How to Add AdShuffle to Your Page

To use AdShuffle on your website, simply add the following script tag to your HTML file:

<script src="https://ad-shuffle.codions.dev/dist/ad-shuffle.es.js"></script>
            

This script will enable the functionality of banner rotation, allowing you to define banners with frequencies, start and end dates, and more.

Example 1: Sequential Auto-Rotation Every 3 Seconds

This container rotates banners automatically every 3 seconds, in sequential order.

Advertisement
Banner 1
Advertisement
Banner 2
Advertisement
Banner 3

Example 2: Random Auto-Rotation Every 5 Seconds

This container rotates banners automatically every 5 seconds, with random selection.

Advertisement
Banner 1 (50% Frequency)
Advertisement
Banner 2 (30% Frequency)
Advertisement
Banner 3 (20% Frequency)

Example 3: No Auto-Rotation (Random Initial Selection)

This container selects a random banner initially, based on the defined frequencies, but does not rotate automatically.

Advertisement
Banner 1 - Frequency 25% (Starts 2024-09-10)
Advertisement
Banner 2 - Frequency 75%

Example 4: Equal Frequencies

This container displays banners with equal frequencies (33%).

Advertisement
Banner 1 - Frequency 33%
Advertisement
Banner 2 - Frequency 33%
Advertisement
Banner 3 - Frequency 33%

Example 5: Dynamic Ad Zone Loaded from Endpoint

This example demonstrates how to use the AdShuffle SDK to load an ad dynamically from an external endpoint. The ad content is fetched and displayed within the specified container.

Advertisement
Loading ad...
Advertisement
Loading ad...