AdSense for Content Ad Settings

Once your AdSense account has been approved, you’ll likely 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 in to Google AdSense and click the Ad Settings tab. The AdSense for Content Wizard, shown in Figure 8-13, will open.

Note

You can choose to enter all your settings at once by selecting the single page option; it’s equivalent to the Wizard and may be quicker to use once you are familiar with AdSense.

Ads are supplied by Google in units. An ad unit contains from one to six ads. For example, an ad unit was shown earlier in Figure 8-10.

A link unit, shown in Figure 8-14, contains four or five links to pages listing ads.

Your first choice is to decide which kind of unit—ad or link—you want to display.

If you select an ad unit, the drop-down list to the right of the ad unit radio button (shown earlier in Figure 8-13) 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.

Ad units display ads directly on your pages, where they are probably more likely to be clicked than link units. Link units 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 and the ad pages can contain many ads.

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 are the best ways to find what works on your site.

After you’ve chosen the type of ad unit you are configuring, click Continue to open the Ad Format and Colors panel of the Wizard.

If you are configuring an ad unit (as opposed to a link unit), you will see a page like that shown in Figure 8-15.

If you are configuring a link unit, this panel will look slightly different, as you can see in Figure 8-16.

The Colors section, shown in Figure 8-18, lets you choose the colors for text and other elements of your AdSense ad units so that your ad units work well with your site.

You can choose from a number of existing color schemes, called color palettes, for your ad unit, or design your own color scheme. It’s likely that you will want to pick your own colors, either to match your pages or to stand out from your pages. In that case, you should save your scheme as a custom palette by clicking the “Save as new palette” link shown in Figure 8-18.

The best way to see which (if any) of the existing color palettes is right for a given web page or site, and to see the impact of your custom color choices, is to run through the list of possibilities in the Palettes drop-down list. When you select a color palette, an example showing the appearance of the ad elements using that scheme will display to the left under the word “Sample.”

If you are configuring an ad unit, you can choose a corner type for the unit. The choices are square corners, slightly rounded corners, or very rounded corners. If you don’t make a choice, you will get square corners.

If Google doesn’t have an ad to display on your web page—because it hasn’t figured out what would be contextually relevant or because there’s nothing in the Google ad inventory that matches your content—Google 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-19). 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.

Channels are a mechanism for keeping track of which part of a site—or which site, if you are managing multiple sites in one AdSense account—is 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-20.

In addition to custom channels, URL channels, which track ad unit clicks by URL, can help you keep track of how your Google ad and link units are doing. See Using Channels for more information about channels.

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

Suppose you decided to create a Skyscraper (120×600) ad unit using a custom color palette and very rounded corners (and otherwise accept the default options from Google). The next step is to give the ad unit a name, as shown in Figure 8-21.

Once you’ve named your ad unit, click “Submit and Get Code.” Next, click the code box shown in Figure 8-22 to select and then copy the code for the unit you have specified.

Here’s the complete code for the ad unit:

<script type="text/javascript"><!--
google_ad_client = "pub-5493015234961725";
/* 120x600,1/28/09, Homepage above the fold */
google_ad_slot = "1963938419";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

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 couple of variables are set, including your publisher ID and an ID for the ad (the google_ad_slot value). Next, a remote script on Google’s server, show_ads.js, is called. This script generates the HTML for the ad unit that displays on your page.

It’s your job to paste the code that Google has generated into position in the pages served by your web server. The specifics of the tools you need to use to do this depend upon many variables, but it’s no different than making any other changes to your web pages.

Figure 8-23 shows adding the Google code to a PHP web page using a PHP code editor.

Once you’ve created it, you can change the configuration of an existing ad unit without modifying the code using the Manage Ads page (see Managing Ads).

Suppose you decided to display a link unit with five links and a dimension of 120×90 pixels. Here’s the code AdSense would generate for you to copy and paste:

<script type="text/javascript"><!--
google_ad_client = "pub-5493015234961725";
/* 120x90, created 1/28/09 */
google_ad_slot = "4665943536";
google_ad_width = 120;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Paste the link unit code into one of your web pages (or an include file), and copy the pages or include file to your server. The link unit will then appear on your site, hardly taking up any space at all, and look just like more links, as shown in Figures 8-14 and 8-24 beneath the ad unit. If you click on one of the links in the link unit, a Google page consisting of contextual ads will open (Figure 8-25).

Click the Manage Ads link on the AdSense Setup tab to open the Manage Ads page, shown in Figure 8-26. The Manage Ads page lets you modify ads you’ve already created. It’s a very nice feature that lets you change ads on the fly without having to change the code in your web pages.

To change the settings for a specific ad, click the Edit Ad Settings link.

Suppose you don’t like the default color schemes for ads that Google offers. You can create new color schemes or modify an existing scheme by clicking the Color Palettes link on the AdSense Setup tab.

Using the Color Palettes 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-27).

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 Choose Ad Color and Formats page (Figure 8-28).

The Channels page, opened by clicking the Channels link on the AdSense Setup 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 www.digitalfieldguide.com will track ads served and clicked on this URL and ads on any page below that address (for example, ads on pages in www.digitalfieldguide.com/blog/). In contrast, the URL channel www.digitalfieldguide.com/index.php tracks activity only on the page index.php. Figure 8-29 shows the interface for creating and managing URL channels.

Custom channels are not limited by the domain and directory structure of your web server, and track activity from an ad unit—wherever it is located—that 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).

Custom channels allow you to track AdSense information as you’d like to see it, perhaps divided by subject matter rather than web addresses. In addition, one important use of custom channels is to allow advertisers to use a channel as an ad target, meaning to place ads only on the pages referenced by your channel. This allows you to carve out web “real estate” aimed at specific kinds of advertisers—for example, only pages that relate to digital cameras. To implement a custom channel as an advertisement target, click the edit settings link for the custom channel in the page used to create and manage custom channels shown in Figure 8-30.

Sometimes 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 display URL or destination URL, from appearing on your site, click the Competitive Ad Filter link found on the AdSense for Content tab. Enter the addresses you want to ban in the box shown in Figure 8-31.

There are some other settings you should know about, accessed as links on the AdSense Setup tab. Depending on your situation, you may never want to use these settings. On the other hand, for some sites they are quite important: