8.4. AdSense Ad SettingsOnce 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 CodeThe 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:
8.4.1.1. Ad typeAds 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 pagesFigure 8-5. You can choose between ad units and link unitsIf 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.
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. 8.4.1.2. Ad layoutThe 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
If you are specifying a link unit (in pixels, width first), your size choices, shown in below are different:
8.4.1.3. Color palettesColor 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 unitThe 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 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).
8.4.1.4. Alternate URL or colorIf 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
8.4.1.5. Selecting a channelChannels 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 throughsIn 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. 8.4.1.6. Putting the ad on a frameHTML 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.
8.4.2. Grabbing the CodeWith your Google unit selections made, it's time to grab the code for your unit and place it in your web page. 8.4.2.1. Ad unit exampleSuppose 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 pageHere'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/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 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.
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 page8.4.2.2. Link unit exampleSuppose 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/http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
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 ColorsThe 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 linksFigure 8-13. The links in each link unit open a page of contextual adsUsing 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 siteFigure 8-15. Custom palettes are available on the Ad layout code page8.4.4. Using ChannelsThe 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 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-16 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 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
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 tracking8.4.5. Applying Competitive FiltersSome 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
|