Compatible XF Versions 2.0 2.1 2.2
This code is directly from Google support. Please note that this will not work for AutoAds.
If you find that our responsive ad code doesn't do everything you need, you may modify your ad code to better meet the requirements of your responsive site. The following examples show you how to correctly make these modifications.
Note: The examples described in this article are acceptable modifications of the AdSense ad code. You won't violate the AdSense Program policies by modifying your responsive ad code in these approved ways.
Here's some modified responsive ad code that sets the following exact ad unit sizes per screen width:
Read more
Continue reading...
This code is directly from Google support. Please note that this will not work for AutoAds.
If you find that our responsive ad code doesn't do everything you need, you may modify your ad code to better meet the requirements of your responsive site. The following examples show you how to correctly make these modifications.
Note: The examples described in this article are acceptable modifications of the AdSense ad code. You won't violate the AdSense Program policies by modifying your responsive ad code in these approved ways.
Exact ad unit size per screen width example
This example shows you how to modify your responsive code to set specific ad unit sizes for three ranges of screen widths, i.e., mobile, tablet and desktop. You don't need to have any previous experience of CSS media queries or modifying AdSense ad code to follow this example.Here's some modified responsive ad code that sets the following exact ad unit sizes per screen width:
- For screen widths up to 500px: a 320x100 ad unit.
- For screen widths between 500px and 799px: a 468x60 ad unit.
- For screen widths of 800px and wider: a 728x90 ad unit.
To adapt this sample code for your own site:
Read more
Continue reading...