• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

Different banners for mobile and desktop

In my view, you should do this on the ad distribution side of things.

BEST ads for this are responsive ones. I use Google Adsense Responsive and it gives the right size for each device.
 
For adsense responsive should do but if you want to use different ad code which is not responsive, try the below code it serves ad based on window width.

Code:
<script type="text/javascript">

var width = window.innerWidth
   || document.documentElement.clientWidth
   || document.body.clientWidth;

   if (width >=1280) {    
     <!--// <![CDATA[
     adcode('leaderboard');
     // ]]> -->
   } else if ((width < 1280) && (width >= 640)) {    
     <!--// <![CDATA[
      adcode('banner');
     // ]]> -->  
   } else {    
     <!--// <![CDATA[
      adcode('mobilebanner');
     // ]]> -->    
   }
</script>
 
Back
Top