Web-based advertising via banner ads and such has yet to
grow into the vast revenue stream as envisioned in the early days of the Web.
While larger sites do make money from online advertising, it is often harder
for smaller sites to realize the benefits. Google’s AdSense levels the playing
field by allowing sites of all sizes to earn money via relevant advertising.
Let’s take a closer look at the AdSense program and explore how you may use it
on your site.

What is it?

The key feature of AdSense is the minimum amount of time it
takes to insert advertising on your site. It allows you to earn advertising
revenue from each site page. Relevant ads based on the site’s content are
delivered to a site as text or images. You can take it a step further by adding
a Google search field to deliver related ads based upon search criteria. It is
a very flexible solution that allows you to easily incorporate ads on your
site, and it is very easy to get started with the program.

Weekly development tips in your inbox

Keep your developer skills sharp by signing up for TechRepublic’s free Web Development Zone newsletter, delivered each Tuesday.

Automatically sign up today!

Getting started

Google makes it easy to get up and running with AdSense via
an online
. During the sign up process, you specify a business or personal account.
Google defines a personal account for personal users, as well as businesses
with less than 20 employees. The online application is submitted with approval
notification sent via e-mail.

During initial sign up, you must agree with policies that
outline what is permitted under the program. An interesting stipulation is that ads
may not be placed on pages without content, which is a common practice these
days. Also, you must agree to the following guidelines in the application:

  • I
    agree that I will not click on the Google ads I’m serving through AdSense.
  • I will
    not place ads on sites that include incentives to click on ads.
  • I
    agree that I can receive checks made out to the payee name I have listed
  • I will
    not place ads on sites that include pornographic content.
  • I
    certify that I have read the AdSense Program Policies.

The key aspect of the AdSense program is getting paid, so
let’s learn how that works.

Show me the money

The Google ads displayed on your site pages use two cost
structures (for advertisers): cost-per-click (CPC) or cost-per-1,000-impressions
(CPM). The AdSense program displays only CPC ads. This means that advertisers
pay either when users click on ads, or when the advertiser’s ad is shown on a
site. Using this model, you will receive a portion of the amount paid for
either activity on your site. The minimum payment amount is $100, so you won’t
get paid until you have at least that much money in your account. Once you sign
up, you’ll have access to online reports to track account activity.

Making it work

When you have an active AdSense account, you can log onto
the AdSense site and select the AdSense Setup tab. You may utilize an ad unit
(an image- or text-based ad) or a link unit (a group of links to relevant

When working with text or image ads, you can select
horizontal, vertical, or square orientation with various formats. In addition,
you select the color for the ad along with page placement and layout. Once you
make your selections, Google will present you with the code for placing ads on
your site. You can copy and paste the code in the appropriate location or
locations within your site. For example, the code in
Listing A was generated for a small rectangle ad.

A quick review of the JavaScript reveals the height and
width specifications for the ad along with color
settings. You can change the height and width settings, but the ads are
designed for the generated settings so they may not be presented clearly if you
make changes. The key component of the JavaScript is the google_ad_client
variable; this specifies who gets paid for clicks on the ad. This is the id for
your AdSense account. The second JavaScript block (show_ads.js)
is the crux of the code; it loads the ad code from the Google server.

Another product within the program is AdSense for Search. It
allows you to place a Google search field on your site that presents search
results with Google ads, which may earn you money from user clicks. You may
choose a regular Google search or a search of your site. Once again, the code
for the search is generated within the AdSense management pages. Listing B contains the code that was
generated for a Google search.

A few mouse clicks along with the copy and paste of code and
your site is realizing the rewards of advertising placement. While it is a
simple product to utilize, it offers various options as well.

Other options

Along with easy ad and search placement on your pages, the
AdSense program provides some control over what is placed on your site. For
instance, you can ensure competitor ads don’t appear and filters block certain ad types. You may also review ads as well as choose
default ads for your site.


AdSense’s reporting capabilities
are one of the program’s best features. You can easily track what works and what
doesn’t using the program on your site. The reports are too much to cover
in detail, but once you sign up and begin using the program, you’ll appreciate
their power.

Enhance your site and increase your revenue

Developing banner ads or any other types of site
advertisements can be time-consuming. In addition, recruiting advertisers and
handling payment options present problems. Google provides the answer for sites
big and small with its AdSense program, which makes it easy to place ads and
search options on your site with minimal effort. Collecting revenue from the
program is simple as well, so everything is handled without much effort on
your end.

Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.

Miss a column?

Check out the Web Development Zone archive, and catch up on the most recent editions of Tony Patton’s column.