How to disable (AdSense) ads on mobile devices

I know from a lot of testing that it is sometimes wise to use other ad placements for mobile devices than for desktop devices. This tutorial will show you how I set this up for AdSense and different ad types.

With Advanced Ads, there are a couple of methods to activate ads only on mobile or desktop or partially disable ads for specific browser widths. I explain the three ways you can use to set this up below

Exclude AdSense on mobile devices

In Advanced Ads, there is already a visitor condition called device that allows you to display an ad only on mobile or desktop devices.

Just search for the Visitor Conditions meta box on the ad edit screen. Select and add the new condition like on the screenshot below.

Display condition to show ads on different devices

Once you add the condition to the active visitor conditions, you can set it like on the screenshot below to hide the ad on mobile devices.

Exclude AdSense ads on mobile
Choose the Desktop device to hide the ad on mobile devices

You can also do the opposite and show the ad only on mobile devices including tablets.

Hide AdSense ads on desktops
Choose the Mobile option to hide the ad on desktops

Just a few notes on this method:

  • tablets are counted as mobile devices, use the tablet visitor condition to target this device type specifically
  • might not work well on cached websites (see points 2 and 3 below)

As a publisher, I don’t care much about the device but more about the fact that the ad fits the screen. Therefore, the two following methods seem to result in better yields.

Enable AdSense ad for specific browser widths

With the Responsive add-on for Advanced Ads, you can disable ads for specific browser widths.

After installing the add-on, you will find another visitor condition that allows you to select the browser width to enable or disable the ad.

Search for the browser width condition in the Visitor Conditions meta box.

Browser width visitor condition

Here is an example from the Advanced Ads manual to display an ad only for a browser width of at least 480 pixels and a maximum width of 767 pixels. This aims for tablets and larger mobile devices smaller than an iPad.

Tablet targeting

The beauty of this setting is that you can fine-tune your ad delivery by the actual available space rather than the information the device sends out.

Suppose you are using cache on your website. In that case, you should enable cache-busting of Advanced Ads Pro to dynamically check the condition on each page impression and not accidentally cache a mobile ad for desktop devices or vice-versa.

This method is universal for every ad, not just for AdSense. If you are using only AdSense, you should use the following method that works on cached and un-cached websites.

Hide AdSense ads on specific browser widths

Method 2 is perfect if you mix AdSense with other ads, but if you only deliver AdSense ads on one spot and want to display different sizes based on the browser width or even hide the ad on some sizes completely, then you should use this method.

Basically, we are setting up an AdSense responsive ad with custom sizes. This option was removed from the AdSense interface some months ago, so not many publishers know about it.

The Responsive add-on makes it very easy to set up a single AdSense ad with multiple sizes or even hide it.

First, ensure that you selected the AdSense type for your ad, like in the image below.

AdSense ad type in Advanced Ads

Now, go to the Ad Parameters meta box and select Responsive as the AdSense type and Advanced as the Resizing option. Be sure to activate the Responsive add-on to make these options available.

After choosing these options, you should see the following box.

Custom AdSense ad sizes

Enter the default size of your ad in the first row and use the second row to add additional rules. Check the hidden option if you want to hide the ads on the current width.

Let me give you two examples.

Hide the ad on mobile devices

Custom AdSense ad sizes for different browser widths

This setup hides the ad on small screens below 500px but displays a Full Banner (468×60) on medium-size screens and a Leaderboard (728×90) on large screens.

Hide the ad on desktop devices

Hide AdSense ads on desktop devices

This setup displays a Mobile Banner (320×50) on small devices and a Full Banner (468×60) on medium devices but hides the ad on devices larger than 768 pixels.

Setting up a responsive ad like this works with caches and can improve your yields because popular ad sizes typically have higher bids than fully responsive ones.

You should also know that an ad hidden like in the two examples above does not count for the max-3-ads-per-page rule, so you can have a completely different setup for various browser widths.

Thomas

Starting in 2009, Thomas’ own word game website grew to 40 MM page impressions per month. He then built Advanced Ads to help his colleagues to place ads and test different ad positions and networks tests without any coding skills. Thomas now enjoys improving the product for our more than 150,000 users worldwide.

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.