1. Home
  2. Knowledge Base
  3. FAQs
  4. AdSpace Embed Code Use cases

AdSpace Embed Code Use cases

Every Ads4WiFi AdSpace contains an Embed code that can be copied and pasted to an external source allowing you to serve your Advertisers Campaigns without using the Ads4WiFi Landing Pages or M4W Pre-Auth AdSpaces.

To collect your AdSpace Embed code follow the steps below.

  • Login to your Ads4WiFi dashboard
  • Using the Navigation panel to the left, select Network> AdSpace
  • Click the blue edit icon to the right of your desired AdSpace
  • At the bottom of the Edit AdSpace page, there is a ‘Copy to Clipboard’ button that will copy the entire Embed code for you
  • Now paste your Embed code where you want to start serving Advertiser’s Campaigns externally

Using Ads4WiFi Embed Codes on 3rd party captive portals

Using the AdSpace Embed Code you can display Advertiser’s campaigns on compatible captive portal splash pages that are not natively supported by Ads4WiFi by following the steps outlined below.

  • You must add ads.ads4wifi.com and assets.ads4wifi.com to your captive portal walled garden to allow the AdSpace to work as expected.
  • Collect your Ads4WiFi AdSpace Embed Code following the steps at the top of this article. Then Paste it into your Splash page where you want the content to be displayed. Additional modifications to the html code of the page may be required to get the AdSpace to present exactly where you want it.
  • To prevent a broken guest experience, the clicking functionality to reach a Banner’s destination URL must be disabled. To achieve this behavior, you can include the code snippit below on the splash page with an Ads4WiFi AdSpace.
<script src="https://devads.ads4wifi.com/mediaelement/bootstrap/js/jquery.min.js"></script>
<script src="https://devads.ads4wifi.com/mediaelement/build/mediaelement-and-player.min.js"></script>
<script type="text/javascript">
function CustomClickURL(video) {
    if (video.muted) {
        video.muted = false;
        video.play();
    }
}

document.addEventListener('DOMContentLoaded', function() {

    var videoElement = document.getElementById('player1');
    
    videoElement.removeAttribute('onclick');
    
    videoElement.addEventListener('click', function() {
        CustomClickURL(this);
    });
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
    // Disable clickable links
    var links = document.querySelectorAll('a[href*="ads4wifi.com"]');
    links.forEach(function(link) {
        link.removeAttribute('href');
        link.style.pointerEvents = 'none';
        link.style.cursor = 'default';
    });

    var images = document.querySelectorAll('img');
    images.forEach(function(image) {
        if (image.parentElement.tagName === 'A' && image.parentElement.href.indexOf('ads4wifi.com') !== -1) {
            image.parentElement.removeAttribute('href');
            image.parentElement.style.pointerEvents = 'none';
            image.parentElement.style.cursor = 'default';
        }
    });
});
</script>
Updated on February 7, 2024

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT