How to generate your first AdSense ad code?

January 21, 2010 $ Written by EarnBlogger

So, you have successfully created your AdSense account? Congratulations. Now you are only one step behind from earning money by displaying Google ads on your blog or website. After opening an AdSense account, the next step is to get your AdSense code and paste it on your web pages. In this article, I am going to tell you how to create your first AdSense ad code.

Google AdSense

Google displays advertisements on Publisher sites via a simple Javascript code. As a publisher you need to generate and add your custom JavaScript code to web pages. That’s why it is important that you know how to edit the source code of your web pages. Here, I assume that you know how to edit your web page source code! Now, let’s move on to generate your first AdSense code.

Steps to generate Google AdSense code:

  1. Open Google AdSense ( on your web browser and log in to your account.
  2. Locate the AdSense Setup tab inside your account.
  3. Choose your product – AdSense for content to place ads on your site and AdSense for search to add a search box to your site.
  4. Then you will be asked to choose ad type (Ad unit or Link unit). Choose your preferred ad type and press the ‘Continue’ button.
  5. Then you will be asked to choose Ad Format and Colors. Select your preferred ad unit size and specify colors by using a pre-designed color palette or by creating your own. Optionally you can specify font settings, corner styles and alternate ads.
  6. Once you have specified your ad preferences, move to next step pressing the ‘Continue’ button at the bottom.
  7. The next step is to choose your Ad Channels. Custom ad channels can help you track the performance your ad units. Click the “Add new channel” link to create a new ad channel and add it to your ad unit.
  8. Press the ‘Continue’ button and you will be asked to choose a name for the new AdSense unit. Type any name in the text box. This name will help you quickly identify you ad unit when you want to edit it in future.
  9. Now press the “Submit and Get Code” button and you will get you ad code.
  10. Copy the code for your new AdSense unit and add it to the desired location on you web pages to start displaying ads.

That’s it! If implemented correctly, Google ads will soon appear on your pages. Test it by opening your web page on a browser. If nothing appears even after 10 minutes, you have probably made some mistakes in pasting your code. To avoid errors, always copy and paste the ad unit code exactly as it appears in your account, without making any changes or edits. Also note that you code must go between the body tags of your HTML. If you’re using a WYSIWYG editor, always paste the code  in Code or Source view. And don’t forget to save your edits!

This article is suitable for beginners.

Google AdSense logo Copyright by Google Inc.

You might also like:

1 Comment

  1. A great article. The interface is rather fiddly and very easy to give up on for beginners.

    This helps, and would appreciate a piece on using other ad sources, like Chikita?


Leave a Comment