====== Incorporating Google AdSense ads in a wiki ====== The felixibility of DokuWiki lends itself to all sorts of applications, including blogs and CMSs. Some wiki owners have integrated contextual advertising into their wiki, the most popular being [[https://www.google.com/adsense|Google AdSense]]. Mostly this is a simple matter of including Google's code in your DokuWiki template. But Google's [[https://www.google.com/adsense/localized-terms?hl=en|terms and conditions]] disallow the placing of adverts on some pages, including registration and login pages. ===== Adding Adsense to your wiki ===== ==== by adsense plugin ==== You could use [[http://bzed.de/code/dokuwiki/googleads|this plugin]] to integrate adsense into your wiki. It does not allow to include adsense into wiki content yet, but this feature will come. ==== by phpinc plugin ==== You can also use the [[plugin:phpinc|phpinc plugin]] to include the advertising code inside contents. To only show adsense advertising on "normal" page views, check the content of the global ''$ACT'' variable and only print the adsense code when it is set to ''show'': **Note**: the ''$ACT'' is accessed using ''$GLOBALS'' to avoid redeclaring it with **global** scope modifier.