Skip to main content

Adsense Integration

DoubleClick for Publishers AdSense Integration

AdSense is an advertising program that makes it easy to monetize site traffic. By default, advertising display is off. Contact the administrators to enable ads for your site.

Ad unit sizes:

  • 728x90 Leaderboard — Top banner
  • 190x90 Small rectangle — Top right header
  • 300x250 Medium rectangle — Sidebar
    • The Sidebar ad is shown on guides.

Note: Ads are not shown on administrative pages, edit pages, or to users with more than 200 reputation.

Marking pages with custom attributes

It's easy to target AdSense attributes to specific pages by using sponsored flags. Here's the process:

  1. Create a sponsored flag. This flag must have a flagid that started with WIKI_SPONSOR_ or GUIDE_SPONSOR_.
  2. Add that flag to your page. You can add sponsored flags to any of these page types:
  3. Check the source of the page. You should see this Javascript: GA_googleAddAttr("Sponsor", "radioshack");

Note: AdSense attributes can only have lower case letters in them. We allow underscores in flag ids, but strip special characters (including underscores) out for the AdSense attribute. So a flagid of GUIDE_SPONSOR_RADIO_SHACK gets turned into an attribute name of 'radioshack' because we disregard "GUIDE_SPONSOR_". This leaves "RADIO_SHACK" which, in turn, has the remaining underscore removed and is converted to lowercase: turning "RADIO_SHACK" into "radioshack".

Example

Let's create a flag to mark a wiki page in a sponsored campaign. We'll want to lock it down so that only admins can use (and remove) the flag. First, create the flag on the Flags page with this code:

[def_flag
|flagid=WIKI_SPONSOR_RADIO_SHACK
|image=GUIDE_RADIO_SHACK
|title=Weekend Projects
|text=Weekend Projects is part of RadioShack's The Great Create.
|privilege=admin
]

Next, add the sponsored flag to a valid page (see above) with this code:

[flag|WIKI_SPONSOR_RADIO_SHACK]

Finally, view the source on the page. You'll see that 'radioshack' is a sponsored attribute.

GA_googleAddAttr("Sponsor", "radioshack");

Targeting Groups of Content With Area Attributes

We automatically add an "Area" attribute to guides and categories that are properly categorized. You can target ads to an entire area of the site in DFP by using this attribute.

GA_googleAddAttr("Area", "fabrication");

Go back to the Help Index

TRUSTe