• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • This community is user driven. Be polite with other users.
    • We recommend purchasing a Chevereto license to participate in this community.
    • Purchase a Community Subscription to get even faster ticket response times.

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