Ads Manager 2 by Siropu

Ads Manager 2 by Siropu [Paid] 2.5.4

No permission to buy (€49.99)
@Siropu - can you see if option to renew ad for multiple months can be added, currently only when creating new ad multiple month option is available, but not when you would like to renew existing ad.
 
Try this code just below you actual ad code (for position "Sidebar below"):
Code:
<xf:js>
$(function()
{
     var unit = $('.samCodeUnit[data-position="container_sidebar_below"]');

     if (unit.length)
     {
          var unitOffset = unit.offset().top;

          $(window).scroll(function()
          {
               var unitScrollOffset = unit.offset().top;
               var scrollTop = $(document).scrollTop();

               if (unitScrollOffset - scrollTop <= 0)
               {
                    unit.css({position: 'fixed', top: $('.p-nav').height() + 10, width: 'auto'});
               }
               else if (scrollTop <= unitOffset)
               {
                    unit.css({position: '', top: '', width: ''});
               }
          });
     }
});
</xf:js>
Hi @Siropu , I have been using this code to make ads "sticky" in the sidebar. Unfortunately, this no longer works after the update from 2.2.16 to 2.3.3 (in Ads Manager 2.5.3). How do I have to modify the code? Thanks!
 
How do I have to modify the code?
Try this:

JavaScript:
<xf:js>
var unit = document.querySelector('.samCodeUnit[data-position="container_sidebar_below"]');

if (unit) {
    var unitOffset = unit.getBoundingClientRect().top + window.scrollY;

    window.addEventListener('scroll', function() {
        var unitScrollOffset = unit.getBoundingClientRect().top + window.scrollY;
        var scrollTop = window.scrollY;

        if (unitScrollOffset - scrollTop <= 0) {
            unit.style.position = 'fixed';
            unit.style.top = document.querySelector('.p-nav').offsetHeight + 10 + 'px';
            unit.style.width = 'auto';
        } else if (scrollTop <= unitOffset) {
            unit.style.position = '';
            unit.style.top = '';
            unit.style.width = '';
        }
    });
}
</xf:js>
 
Is there any way we can do A/B testing for a banner? Usually, we upload 2 versions of the banner and see which one perform better.
 
Set them up as 2 different banners, each will have its own stats.
I have several banners (A, B, C) for the same location say header. Each banner has the same views count say 10k a month.
If I add another banner to A/B test then it will not accurately gauge the views stats.
What I really want is to split the banner A into 2 separate banners to test it within the allotted views count.
 
JavaScript:
<xf:js>
var unit = document.querySelector('.samCodeUnit[data-position="container_sidebar_below"]');

if (unit) {
    var unitOffset = unit.getBoundingClientRect().top + window.scrollY;

    window.addEventListener('scroll', function() {
        var unitScrollOffset = unit.getBoundingClientRect().top + window.scrollY;
        var scrollTop = window.scrollY;

        if (unitScrollOffset - scrollTop <= 0) {
            unit.style.position = 'fixed';
            unit.style.top = document.querySelector('.p-nav').offsetHeight + 10 + 'px';
            unit.style.width = 'auto';
        } else if (scrollTop <= unitOffset) {
            unit.style.position = '';
            unit.style.top = '';
            unit.style.width = '';
        }
    });
}
</xf:js>
How do I have to modify the code so that it is ignored on mobile phone? The ad should not be sticky there.
 
Last edited:
How do I have to modify the code so that it is ignored on mobile phone?
Try:
JavaScript:
<xf:js>
var unit = document.querySelector('.samCodeUnit[data-position="container_sidebar_below"]');

if (unit && !/Mobi|Android/i.test(navigator.userAgent)) {
    var unitOffset = unit.getBoundingClientRect().top + window.scrollY;

    window.addEventListener('scroll', function() {
        var unitScrollOffset = unit.getBoundingClientRect().top + window.scrollY;
        var scrollTop = window.scrollY;

        if (unitScrollOffset - scrollTop <= 0) {
            unit.style.position = 'fixed';
            unit.style.top = document.querySelector('.p-nav').offsetHeight + 10 + 'px';
            unit.style.width = 'auto';
        } else if (scrollTop <= unitOffset) {
            unit.style.position = '';
            unit.style.top = '';
            unit.style.width = '';
        }
    });
}
</xf:js>
 
The code provided doesn't do anything to ad display.
That's strange. Maybe it's because of Google AdSense that the ad isn't displayed on mobile? 🤷‍♂️

If I create the ad 2x with different device criteria once with the code (desktop + tablet) and once without the code (mobile phone) it works.
 
I’ve had a peculiar problem since we started using AD Manager several years ago! The banners loaded through this system cause the "Largest Contentful Paint" to spike to 7.5 seconds in Google’s website test. I’ve tried uploading all the banners to Cloudflare’s paid image proxy without success.

If I disable all the banner spots at the top, the site becomes four times faster. How can I solve this issue with these banners and LCP?

Lazy loading is enabled!
 
Back
Top Bottom