Section 8.4. AdSense Ad Settings

8.4. AdSense Ad Settings

Once your AdSense account has been approved, you probably want to get started by adding the code that will place Google's ads on your site. To get started with AdSense for Content , log into Google AdSense, and click the Ad Settings tab. The Ad layout code page will open.

8.4.1. Getting Ad Layout Code

The Ad layout code page is used to generate code for content ads that you will place in your web pages. There are a number of sections of the Ad layout page used for choosing options, including:

  • Ad Type

  • Ad Layout

  • Color palettes

  • Channel choice (see "Using Channels" later in this chapter for more information) Ad type

Ads are supplied by Google in units. An ad unit contains from one to six ads. A link unit, shown in Figure 8-4, contains four or five links to pages listing ads.

Your first choice is to decide which kind of unitad or linkyou want to display (Figure 8-5).

Figure 8-4. A link unit displays links to Google ad pages

Figure 8-5. You can choose between ad units and link units

If you select an ad unit, the drop-down list to the right of the ad unit radio button (shown in Figure 8-5) is used to determine whether only text ads will be displayed in the unit, only image ads will be displayed in the unit, or both.

You can also just leave the text ad/image ad setting for the unit at the default you selected when you signed up for the AdSense program or that you chose in your account options.

When you choose to generate code for a link unit, the drop-down list to the right of the link unit radio button is used to decide whether the link unit will provide four or five links.

Ad units display ads directly on your pages, where they are probably more likely to be clicked than link units. Link units, a relatively new kind of Google unit, are in some ways one step removed; a link unit presents links to ads rather than the ads themselves. But the advantage of the link unit is that it takes up almost no space. This effective use of real estate makes sense if your site visitors are affirmatively looking for additional resources related to a topic rather than "impulse clicking." Once again, experimentation and trial and error is the best way to find what works on your site. Ad layout

The Ad Layout section of the ad layout code page is used to specify a size for your ad or link unit. Figure 8-6 shows the drop-down list of choices for ad units, which are also shown in Table 8-1.

Figure 8-6. If you are specifying an ad unit, you select its size from this drop-down list

Table 8-1. Ad unit names and sizes

Unit name

Size (in pixels) (width first)



728 x 90

Text and images


468 x 60

Text and images

Large Rectangle

336 x 280

Text ads only

Medium Rectangle

300 x 250

Text and images


250 x 250

Text ads only

Half Banner

234 x 60

Text ads only

Small Rectangle

180 x 150

Text ads only

Wide Skyscraper

160 x 600

Text and images


125 x 125

Text ads only


120 x 600

Text and images

Vertical Banner

120 x 240

Text ads only

If you are specifying a link unit (in pixels, width first), your size choices, shown in below are different:

728 x 15
468 x 15
200 x 90
180 x 90
160 x 90
120 x 90 Color palettes

Color palettes are schemes for the text and graphs of ad units that Google provides so that your ad units will work well with your site. These color schemes, as you can see in Figure 8-7, have fanciful names, like Wicked Witch and Black Night.

Figure 8-7. You can choose from a number of existing color schemes, called a color palette, for your ad unit

The best way to see which (if any) of these color palettes is right for a given web page or site is to run through the list of possibilities in the drop-down list shown in Figure 8-7. When you select a color palette, an example showing the appearance of the ad elements using that scheme will display.

You can select multiple palettes by holding down the Control key (Windows) or Command key (Mac). If you do this, the ad display will rotate using the palettes you've selected.

You can also create your own color palettes from scratch, if nothing that is available out of the box meets the needs of your site (see "Custom Ad Colors" later in this chapter for details).

What Color Choice Works Best?

There's a lot of discussion in webmaster circles about what AdSense color (or color palette) choice works best. Ultimately, nobody really knows; it is different for different sites, and experimenting and watching the results make sense.

That said, there are two circulating theories that have strong advocates (but happen to be contradictory):

  • Use the color palette to match your site (if you do this, it is speculated, some users may click on the ads because they think they are part of your site, not ads).

  • Make a color choice that starkly contrasts with your site (by doing this, the ads are made more noticeable, and thus it is more likely that they may be clicked). Alternate URL or color

If Google doesn't have an ad to display on your web pagebecause it hasn't figured out what would be contextually relevant, or because there's nothing in the Google ad inventory that matches your contentGoogle will display a public service ad of its choice. There's nothing wrong, in my opinion, with public service ads, and personally I always elect to display them. However, some webmasters do not like to give away their "real estate" without getting something in return.

You can change the behavior of a Google ad unit when it doesn't have an ad to serve by choosing either an alternate URL or a color code (Figure 8-8). The obvious use for an alternate URL is to use it to link to a standby ad of your own, so that the real estate occupied on your site by the Google ad unit can be productive even when Google doesn't have any ads to serve. The Color code box is used to enter a color specification in hexadecimal RGB notation . To get the hexadecimal for a color, you can click the Choose a color link. Select the color you'd like from a palette and Google will supply the hexadecimal code. This color will be displayed in the Google unit when there is no ad to serve.

Figure 8-8. If you choose an alternate URL, or a color code, Google will not display public service ads

The best use for the color alternative is to specify the background color of your site. That way, if Google doesn't have an ad to serve, the Google ad unit will not be visibleit will just look like part of your site background. Selecting a channel

Channels are a mechanism for keeping track of which part of a siteor which site if you are managing multiple sites in one AdSense accountis generating clicks. Custom channels are channels that you define in advance of ad deployment. A Google unit can be assigned to a custom channel you've created, as shown in Figure 8-9.

Figure 8-9. Custom channels are user-defined and can help you keep track of pages and groups of pages and their click throughs

In addition to custom channels , URL channels , which tracks ad-unit clicks by URL, can help you keep track of how your Google ad and link units are doing. See "Using Channels" later in this chapter for more information about channels. Putting the ad on a frame

HTML frames allow publishers to present documents in multiple views, which may be independent windows or subwindows. One view may be kept visible while other views are scrolled or replaced. An HTML page made up of frames (views), called a frameset, is defined using the <frameset> tag. The location of each view is specified in a <frame> tag.

If you intend to put your Google ad unit on a page that is part of an HTML frameset, it is important that you ensure the ad will be placed on a framed page box.

Frames are pretty unpopular these days among people who construct web sites because users can find them irritating and they sometimes don't work well with web browsers.

8.4.2. Grabbing the Code

With your Google unit selections made, it's time to grab the code for your unit and place it in your web page. Ad unit example

Suppose you decided to create a Leaderboard (728 x 90) ad unit using the Steely Gaze palette (otherwise accepting the default options from Google). The next step is to click the code box shown in Figure 8-10 to select and then copy the code for the unit you have specified.

Figure 8-10. The next step is to copy and paste the code from the box into your web page

Here's the complete code for the ad unit:

     <script type="text/javascript"><!--     google_ad_client = "pub-XXXXXXXXXXXX";     google_ad_width = 728;     google_ad_height = 90;     google_ad_format = "728x90_as";     google_ad_type = "text_image";     google_ad_channel ="2144598502";     google_color_border = "CCCCCC";     google_color_bg = "FFFFFF";     google_color_link = "000000";     google_color_url = "666666";     google_color_text = "333333";     //--></script>     <script type="text/javascript"       src="/books/2/226/1/html/2/">     </script>

The actual Google publisher ID has been replaced with Xs in this example.

If you look at the code that makes up this Google ad unit, it is really a very simple affair, built using JavaScript. First, a variety of variables are set, such as the ad size, colors, and publisher ID. Next, a remote script on Google's server, show_ads.js, is called. This script generates the HTML for the ads that are displayed on your page.

It's best to place AdSense code within includes so you can modify one file and have the changes displayed simultaneously on many pages. See Chapter 1 for more information on using includes for your advertising.

Figure 8-11 shows the Leaderboard ad unit displayed with ads on a web page.

Figure 8-11. The Leaderboard ad unit is displayed on this web page Link unit example

Suppose you decided to display a link unit with five links, 200 x 90, in the Black and Blue palette (otherwise accepting the default options). Here's the code AdSense would generate for you to copy and paste:

     <script type="text/javascript"><!--     google_ad_client = "pub-XXXXXXXXXXXXXXXX";     google_ad_width = 200;     google_ad_height = 90;     google_ad_format = "200x90_0ads_al_s";     google_ad_channel ="2144598502";     google_color_border = "000000";     google_color_bg = "F0F0F0";     google_color_link = "0000FF";     google_color_url = "008000";     google_color_text = "000000";     //--></script>     <script type="text/javascript"       src="/books/2/226/1/html/2/">     </script>

Placing AdSense Ads on Your Pages

Publishers may well wonder where they should place AdSense ads on their pages for the best results. There's a great deal of speculation about AdSense ad placement in webmaster circles, and not much hard data.

It is clear that ads placed above the foldmeaning in the top third of the page, where they will be seen on any computer monitor without scrolling downdo better than ads placed lower in a page.

The best-performing AdSense ad format and position is Leaderboard (also called a horizontal skyscraper) close to the top of a page. The second-best format is one of the several vertical skyscraper formats (Skyscraper and Wide Skyscraper), with the top ad very close to the top of the page, either along the left or right side. If a vertical skyscraper is positioned along the right side of a page, then you need to take care to use a page design with a total width less than 800 pixels so that the skyscraper along the right-hand side will display without horizontal scrolling on all monitors.

Beyond this basic placement information, you might want to consider whether it makes sense to put a great many ads on a single page (the Google limit is three ad units). There's something to be said for placing a great many ads on a pagethe variety might produce good choices for more visitors. However, the "noise" of displaying many ads can detract from your site, and some publishers get better results with fewer ads.

The bottom line is that you should experiment with ad placement and the number of ads on your site. What works well for your site is not necessarily what works well for another site, so there is no substitute for trial and error.

Paste the link unit code into an include file, copy the include file to your server, and modify your content pages so they include the link unit file. The link unit will then appear on your site, hardly taking up any space at all, and just look like more links, as shown in Figure 8-12. If you click on one of the links in the link unit, a Google page consisting of contextual ads will open (Figure 8-13).

8.4.3. Custom Ad Colors

The Ad Colors page can be opened by clicking the Ad Colors link on the Ad Settings tab or from the Manage color palettes link on the Ad code layout page.

Figure 8-12. This ad unit, shown on the lower right, consists simply of links

Figure 8-13. The links in each link unit open a page of contextual ads

Using the AdColors page, you start with one of the built-in Google palettes. Next, you can modify each of the colored elements of the palette, either by specifying an RGB hexadecimal color value or by choosing colors from a color picker (see Figure 8-14).

Once you have the color scheme you want, you can save your custom palette (using any name you'd like). Your custom palette will be added to the list on the Ad layout page (Figure 8-15), which opens if you click Save and get code.

Figure 8-14. Creating your own custom palettes makes it easy to match the design of your site

Figure 8-15. Custom palettes are available on the Ad layout code page

8.4.4. Using Channels

The Channels page, opened by clicking the Channels link on the Ad Settings tab, lets you define URL and custom channels .

URL channels are tracked by web address, and you can add these at any point. You can use URL channels to track a single page, a directory in a domain, or an entire domain. For example, the URL channel will track ads served and clicked on this URL and ads on any page below that address (for example, ads on pages in In contrast, the URL channel tracks activity only on the page index.php. Figure 8-16 shows the interface for creating and managing URL channels.

For information about using URL channel information to understand your Google AdSense activity, see Chapter 9.

Custom channels are not limited by the domain and directory structure of your web server and track activity from an ad unitwherever it is locatedthat is linked to the custom channel. The catch is that for this to work, you need to have created the custom channel and associated the ad unit with that channel before deploying the ad unit. In contrast, you can always add a URL channel (but URL channels are not flexible in terms of the information they report).

Figure 8-16. URL channels track activity by web address, so you can use them to monitor impressions and clicks on specific pages, directories, and domains

The need to specify a custom URL channel before you deploy your ad code is a serious drawback. Things do change often and quickly on the Web. Adding, or changing, custom channels means changing the actual ad unit code in your pages.

Figure 8-17 shows the interface used to create custom channels.

Figure 8-17. Custom channels must be defined before they can be deployed but can be used for granular ad unit tracking

8.4.5. Applying Competitive Filters

Some times it's a good idea to filter ads so that they don't appear on your site. The most common reason for doing this is to make sure that competitors' ads don't appear on your site, but you might also simply want to make sure that ads from organizations you find offensive don't appear beside your web content.

To block ads, based on their destination URL, from appearing on your site, click the Competitive Ad Filter link found on the Ad Settings tab. Enter the addresses you want to ban in the box shown in Figure 8-18.

Figure 8-18. You can easily filter out ads from your competitors or that you find offensive

Finding That Offensive URL

Suppose an AdSense ad appears on your site that you really don't like and want to ban. How do you determine what URL to use in the Competitive Ad Filters dialog to exclude the ad?

Following these steps will let you find the URL you need to ban:

  1. Right-click the ad title (the portion of the ad that is a hyperlink).

  2. If you are using Internet Explorer, select Copy Shortcut. On Mozilla or FireFox, the command will be something like Copy Link Location.

  3. Paste the selection into a text editor like Notepad.

  4. The destination URL for the ad will appear following the adurl= portion of the URL, and continue up to the ampersand (&).

For example, if the pasted selection is something like this (portions of the ad string have been omitted):

then the destination URL is

Google Advertising Tools. Cashing in with AdSense, AdWords, and the Google APIs
Google Advertising Tools: Cashing in with Adsense, Adwords, and the Google APIs
ISBN: 0596101082
EAN: 2147483647
Year: 2004
Pages: 145
Authors: Harold Davis

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: