Adsense-wrapper for DFP

July 8, 2011 | 4:56 p.m. CDT

A couple months ago Gary Hesse, a designer at the Wenatchee World where I work was working on the redesign of our main site when he asked me if I knew of a way to simplify how we display ads on our site. We currently use DoubleClick for Publishers which was going to require him to edit 30+ templates if he used the default javascript that DFP gives you to serve ads.

I decided if I was going to simplify how we displayed the ads I was going to need to come up with a way to keep track of all our 100+ ad spots and match them up with what urls the ad spots appear on. The solution I came up with is my adsense-wrapper script.

With permission from my boss, I've put the code on Github so that others might be able to benefit from it and or help us improve it. Please feel free to clone/download the code and kick the tires.

Related tags: adsense, Javascript, wenatcheeworld

Post Your Comment

(Optional & Not Displayed)


(allowed tags - strong, em, cite, & code)

Post Guidelines

Please be considerate of others. Keep comments relevant. Content deemed inappropriate or offensive may be edited and/or deleted. Email addresses are never displayed.

Line breaks and paragraphs are automatically converted — no need to use p or br/. Quotes, apostrophes, and double-dashes are automatically converted to smart punctuation. Be careful when copying and pasting portions of entries or other comments.

Links can be created using the standard <a href="http://url">urlName</a>. The following inline HTML elements may also be used: strong, em, cite, & code. The title attribute is allowed within any element. All other code will get removed before posting.