Ad code implementation
About custom-sized ad units
If you’re looking for a specific ad size that’s not one of our standard ad sizes, you might want to create a custom-sized ad unit. With custom-sized ad units you specify the width and height of the ad that you want to appear on your page. Custom-sized ad units behave just like their standard size counterparts, showing a text or display ad depending on which will have the best performance for the impression. Note that custom-sized ad units are fixed sized ad units, i.e., they don’t dynamically change their size or respond to changes in screen orientation. If your site uses responsive design, we recommend that you use a responsive ad unit instead.
You should consider using custom-sized ad units if you:
- Have a regional ad format that we do not offer in the AdSense interface
- Need a custom size to better fit the layout of your page.
To ensure that ads continue to deliver a positive user experience, we’ve put a few restrictions in place around maximum and minimum pixels for ad sizes. Any custom-sized ads that fall outside of the restrictions below won’t appear when placed on a page.
Custom-sized ads are required to adhere to the AdSense ad placement policies. Additionally, the following size restrictions will be enforced:
- Only one dimension can be greater than 450 pixels
- The minimum width is 120 pixels
- The minimum height is 50 pixels
- Neither height nor width can exceed 1200 pixels.
Please note that we may change these policies. If you implement custom-sized ads, please check back here to ensure that your sites are in compliance. As always, please use your best judgement when using custom-sized ad units; ad units similar in size to the 300x600 ad format will be subject to similar placement restrictions. Ads will not be served to ad units in violation of these restrictions. Bear in mind that the look and feel of your text ad units will depend on your ad unit dimensions.
For text ads, custom-sized ads will behave similarly to the standard formats you’re used to seeing. We’ll determine the optimal number of text ads to display for a given impression, and show the ads the same way they appear inside standard sizes. Here are three examples of custom-sized ad units displaying text ads:
For display ads, our system will determine the appropriate size display ad to fit into the space you select and will not be larger than the space requested. Here are three examples of custom-sized ad units showing display ads:
Please note that the dotted border is only present to show the total size of the ad unit, and won’t actually appear on your pages.