Updated April 21, 2016
In the Adsense Help forum there are often requests on how to generate an ad code, and where to find it, so this page is for all those Newbies who are finding it difficult to follow the written information. These are the basic steps for generating ad codes for your website or blog from within your AdSense Account.
You won't get to choose what ad is displayed, or what company's ad is displayed, but you do get to decide if you want ads that contain images, or ads that only contain text, or a combination of both, and you'll select your ad block sizes, and the colours, or you can select a link unit instead of an ad unit.
Login to your AdSense account and look for the "MyAds" tab along the top menu. Once you've selected the "MyAds tab" in your AdSense account, a new page will open where you begin to make your choices for the design of your ad.
|Setting up your AdSense ad unit.|
The first thing you want to do is give the ad unit a name. The name is simply a way for you to tell which ad unit it is - what name you give it is your choice. You can use the name of your site, or the name of the place you want the ad for (ie: "mysite header", "mysite sidebar", etc.).
When you click the "recommended" tab you'll see a series of options to choose:
|Choosing the type of ad you want.|
|Setting the size for a custom-sized ad unit.|
|Responsive ad options.|
|Choosing specific ad sizes.|
Each time you choose an option in the "recommended" box, you'll get another box to choose something From. If you choose Custom, the box you get lets you pick your pixel size (height and width) for the ad. If you choose Responsive, you'll be asked to choose the automatic size or responsive link ads (code for responsive link units is new in 2016), if you choose any other option you'll get a box to choose the size of ad you want.
Simply select the option for whatever it is you want to display on your site.
After choosing the size, select the type of ads you want (ie: text only, image only, or both text/image).
|Choosing options for the ad units.|
Note that "text only" ad units are not the same as link units.
Next you'll choose the colours of your ad ("text ad style"). Note that if you've selected "image only" ads, the colour choices aren't necessary. Image ads display the images that the advertiser has chosen and the ad design created by the advertiser, so changing ad colours for "image only" ads won't have any effect on the ad that displays on your page.
Custom channels is a way to help you track your ad placement's performance, so if you are interested in doing that you can set up a custom channel. While you can't check each individual ad that might appear in this ad slot, you can track the performance of this ad position. So if you are setting up a leaderboard ad to appear at the top position of your website, you'll be able to see statistics relating to this particular spot if you set up a channel for it.
Backup ads must not be AdSense ads. If you use another ad provider use a page with that ad on it. Otherwise, you can choose a plain colour, or blank.
Once you've completed the choices on this page, click "continue" and you'll be given a dialogue box with your ad code in it - note that you can choose synchronous or asynchronous code (the default is "asynch". Don't know what those choices mean? See the explanation in the AdSense Help Center.
|The dialogue box containing the ad code.|
On some website builders there are specified AdSense or link gadget boxes you can use. If you don't know how to do this, you'll need to ask for help in a web development forum or at your webhost if the webhost has provided the website builder.
Make sure you copy everything in the box, from start to finish, and that the code pastes into your website or your notepad in exactly the same way as it displays in the code box on your page.
If you've inserted the code directly into the html of a web page, you will need to save your edits, and publish (or re-publish) your page.