We've moved!

TechKnack.blogspot.com has officially moved to TechKnack.net. You should be redirected in 3-5 seconds. Thank you.

March 10, 2008

Super-target your AdSense ads

Add this post to Del.icio.us. Del.icio.us (0 saved)

While perusing the AdSense Optimization Tips, I came across a section on Blogtimizing, optimizing ad placement on a blog. That article, however, linked to the more interesting concept of section targeting - the idea of super-targeting your ads to a specific section of content, rather than all content on the page (which, on a blog, includes navigation links, blog title, sidebar content, and all sorts of non-topic-specific junk). From the section targeting page:

Section targeting allows you to suggest sections of your text and HTML content that you'd like us to emphasize...when matching ads to your site's content. By providing us with your suggestions, you can assist us in improving your ad targeting. We recommend that only those familiar with HTML attempt to implement section targeting.

To implement section targeting, you'll need to add a set of special HTML comment tags to your code. These tags will mark the beginning and end of whichever section(s) you'd like to emphasize...for ad targeting.

The HTML tags to emphasize a page section take the following format:
<!-- google_ad_section_start -->

<!-- google_ad_section_end -->

So, essentially, to super-target your ads, just wrap the relevant content in these special HTML comment tags. For Blogger blogs using the XML templates, however, it's a bit trickier. More likely than not, you'll want to target your ads to the content of your blog posts. To do so, it would appear obvious to wrap the <data:post.body/> Blogger tag with the appropriate comment tags, like so: <!-- google_ad_section_start --> <p><data:post.body/></p> <!-- google_ad_section_end --> The problem is, Blogger's template engine strips out all HTML comments contained within <b:includable> tags. Fortunately, Blogger themselves have a solution to this issue: <data:adStart/> and <data:adEnd/>: <data:adStart/> <p><data:post.body/></p> <data:adEnd/> These tags will be expanded by Blogger into the desired HTML comments, allowing you to super-target your AdSense ads.

Beware of being too specific in your targeting, however. Google has put in measures against "keyword spamming" your ads:

Include a significant amount of content within the section targeting tags; including insufficient content may result in less relevant ads or PSAs. Please also be sure only to emphasize significant sections of your site's relevant content, since it's against our program policies to the ad targeting to result in ads that are not relevant to the content of your pages.

That means no exclusively targeting your post titles or post tags.

Also of use are the "ignore tags" that go hand-in-hand with the targeting tags:

You can also designate sections you'd like to have ignored by adding a (weight=ignore) to the starting tag:

<!-- google_ad_section_start(weight=ignore) -->

This is good for topic-irrelevant content that appears on pages, specifically the content-ridden sidebar(s) that almost every Blogger blog has. Simply wrap the sidebar div in these tags to de-emphasize its content.

The way I set up my ads was to enable per-post ads (blog layout -> page elements -> click "edit" on the "Blog Posts" element -> check "Show ads between posts"), then move (only!) the <data:adCode/> line to the desired position within my post template, after the fashion of an article on Woork. I then removed all Blogger-added adStart and adEnd tags, and placed my own around my <data:post.body/> line, as specified above. I've found it works rather well on the individual posts' pages, though it seems to get a little confused on the front page. This is understandable, since there are multiple targeted content sections to process on the homepage, all with different content.

After specifying the targeted sections, I wrapped my sidebar content in the ignore tags. In my template HTML (no need to "expand widget templates"), I searched for the sidebar section: <b:section class='sidebar' id='sidebar' preferred='no'> ...all the various widgets... </b:section> And wrapped the entire section in the ignore tags: <!-- google_ad_section_start(weight=ignore) --> <b:section class='sidebar' id='sidebar' preferred='no'> ...all the various widgets... </b:section> <!-- google_ad_section_end(weight=ignore) --> And, voila, ads that are more relevant to my content! Enjoy!

1 comment:

JAC said...

Thanks for a very informative post. I will be sharing your blog link with my readers.

John Carnegie
http://www.cleverjunction.com/cjr/adsense_insurance