Summary:How to add Google AdSense data to your wiki
Prerequisites:This should work for at least PmWiki 2.1 and up
License: CC0
Categories:Includes, Google
Discussion: GoogleAdsense-Talk

Questions answered by this recipe

How do I put my Google AdSense ads on my wiki site?


Custom markup to pull in Google ads.


In config.php, I added:

//long google block markup
Markup('Google1', 'block',
        Keep("<script type='text/javascript'><!--
google_ad_client = 'pub-########';
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = '120x600_as';
google_ad_type = 'text_image';
google_ad_channel ='';
<script type='text/javascript'

The trick is to change all the quotes in the Google paste text to single quotes, then place it within the double quotes of the Keep() function.

Note that I used 'pub-########' because this was done on a client's site and it's not my account number in the text. You will be given code by Google which will contain a number.

Then in a sidebar (I used the Triad skin's Site.RightBar:


Release Notes

  • 2006-11-12 - pre-alpha - just instructions, no downloads - XES November 12, 2006, at 12:51 PM

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

To Do

Make this a full plug-in style recipe where the orientation of the ads and the AdSense code can be pasted in to the markup, allowing different authors to have different AdSense codes in their own groups or pages on the same site.

See Also



See Discussion at GoogleAdsense-Talk

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.