Sporkmonger

purveyor of fabulously ambiguous eating utensils

AdSense Targetting

Posted by sporkmonger
Written December 13th, 2005

I was just reading Nick Wilson’s inverview with Google’s Matt Cutts, which lead me to Google’s page on how to get more control over AdSense targetting.

This is what Google wants you to do in order to block out sections of your html, like navigation elements, for example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

<div class="main">
  <!-- google_ad_section_start(weight=ignore) -->
  <div class="navigation">
    <ul>
      <li class="first">
        <a href="/">Home</a>
      </li>
      <li>
        <a href="/archives/">Archives</a>
      </li>
    </ul>
  </div>
  <!-- google_ad_section_end -->
  <!-- google_ad_section_start -->
  <div class="content">
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Aenean nec risus congue leo gravida euismod. Pellentesque
    habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Donec ut velit. Pellentesque
    habitant morbi tristique senectus et netus et malesuada
    fames ac turpis egestas. Suspendisse vel nibh. Donec vitae
    libero in quam euismod pretium. Duis nec metus. Nam quis
    eros. Donec pretium pretium ante. Aenean quis ante.
  </div>
  <!-- google_ad_section_end -->
</div>

I can’t say I’m surprised at Google’s implementation, it’s certainly the easy way of doing it. But there’s some really glaringly obvious problems here. The most obvious is that we just put stuff into a comment section that isn’t actually, you know, a comment. I’ve been a big hater of IE’s conditional comments since, well, forever, and I know I’m not the only one. It wouldn’t be quite as obnoxious though, if it weren’t for the fact that everything Google needs for correctly processing the page was already present before I added the Google-specific commenting.

Yeah, basically, I’m asking Google to use a microformat instead. Seriously, almost everyone marks navigation blocks with a class or id of “nav”, “navigation”, “header”, “footer” and content with “content”. The practice is already out there, and making use of it would definately help with targetting ads. But if they formalize it a bit they can make sure there aren’t any unintentional side-effects. Perhaps invent two classes, “ad_section”, and “ad_section_ignore” if you have to. Note that I don’t suggest prefixing those with “google_”.

So… Google, can we continue to enjoy our clean, semantically correct pages, or are we going to get stuck with comment-filled ugliness if we want to use AdSense effectively?

(I’m pretending, for the moment, that the code for inserting an AdSense ad in the first place isn’t ugly. I wouldn’t mind a better alternative for this one as well.)

Update: Looks like Google went and collected all the data they needed to implement this.

Tags:

Leave a Response

NOTE: I'm afraid Javascript needs to be on in order to comment.

Comments should be formatted using Textile.

Ruby code should be enclosed within a <macro:code lang="ruby"> element. Other languages are supported. For output you can simply omit the lang attribute.