Adsense Integration
Contents
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:
- Create a sponsored flag. This flag must have a flagid that started with 'WIKI_SPONSOR_' or 'GUIDE_SPONSOR_
'. - Add that flag to your page. You can add sponsored flags to any of these page types:
- Guides (Projects) (example: Macbook Pro HD Cable Install)
- Area Pages (example: Mac Area)
- Category Pages (example: Arduino)
- Item Pages (example: Arduino Uno)
- Check the source of the page. You should see this Javascript: GA_googleAddAtt
r("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_R
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"); Related Learning ¶
Your vote has been recorded.
Tell us more. (optional)