We assume you have a Google AdSense account. If you don't, you can create one using the same login through your Google account. You will be assigned a Publisher identity number which shall appear in all your AdSense codes.
1. Sign in to your account at http://www.google.com/adsense.
2. Visit the My ads tab.
3. From the sidebar, choose the product. If you simply want to display ads on your
4. Click ”+New ad unit” button.
- Name: Provide a unique name and description that will help you find this ad unit later.
- Size: In general, wider ad units perform better. We encourage you to choose one of our recommended ad sizes, which have shown to perform well across a variety of sites.
- Ad type: We encourage you to display both text and image ads. By displaying moread types, you can earn more revenue.
- Ad style: Choose an ad style that complements your page. (View tips.) You can also set a different font face, font size, and corner style, or just use Google defaults.
- Custom channels: Custom channels are an advanced feature that you can use to group specific ad units together. Learn more about custom channels.
- Backup ads: When no targeted ads are available, we'll you can choose to display another ad or color instead.
Change the AdSense code
Your final Google AdSense Code should look something like this:-
Insert code into template
Block copy the entire HTML code for your site that you presently have and save it in a separate text file in MS word or Notepad. Download full Template to backup the template using the “Backup / Restore” button. This is one of the two necessary steps whenever you want to change the template. The second step is to “Preview” the new changes, in edit HTML window you can edit and Preview your changes without saving. Also you can clear your changes. Save the changes only when you are satisfied.
Now search for post.body through your browser's search function (Ctrl+F for Firefox and IE). You should see these lines:-
If you want the AdSense ads to appear between the post title and post body, add the following code above the red lines. If you want the AdSense ads to appear immediately after every individual post, add the following code below the red lines. The code to add is:-
The AdSense Code is the one you have amended above in MS Word or Notepad. Do NOT save the template, but click the Preview button to see if you like the placement of the AdSense ads.
Adjust the AdSense ad margins
Should you want to align the AdSense ad to your text, you can specify a margin or padding around the entire AdSense code. The code you can use is:-
The first number 5px is for the top margin, 10px is for the right margin, 15px for the bottom margin, and 20px for the left margin. You should of course change these values to suit your template.
Preview the template and if you are satisfied, save the template and refresh your Blog to see the new positions of your AdSense ads.