History: AdSense
Source of version: 15 (current)
Copy to clipboard
-= How to Add Google AdSense to your Tikiwiki site =- Please see: ((Module Google AdSense)) ! Banners method !! Create a banner # After enabling the banners feature, go to Admin > Banners. # Click on the __Create banner__ button. # In the __Zone__ section, create a new zone by typing a name (perhaps "AdSenseSkyscraperWide") in the zone text box, then click the __Create__ button. # The page will refresh. Return to the __Zone__ section and select your new zone from the pulldown menu. # Further down on the page, in the __HTML code__ text box paste the code which AdSense gave you. !! Use in a module if desired # Go to Admin > Modules. # Click on the __User Modules__ tab. # In the ''Create a new user module'' section: ## Type in a module name, such as 'AdSenseSide'. ## Type a title ('Ad'?) or a space if you want no title (or you can later use the 'notitle' parameter on the module). ## In the __Banner zones__ pulldown menu, select the name of the banner zone which you created earlier. Click the __plus symbol__ icon to add the banner code to the module. ## Click the __Create__ button. # Click on the __Assign/Edit Modules__ tab. # In the ''Assign new module'' section: ## Select your newly created module in the __Module Name__ pulldown menu. ## Select a __Position__ (left/right) and __Order__ to indicate the location. ## In __Groups__ use Control+Click to select any desired groups (probably __Anonymous__ and __Registered__). ## Use __Preview__ if desired. Remember to click __Assign__ to save your work. !! Use in header/footer or Wiki page if desired The banner can be inserted in an Admin > Look & Feel section, or in a Wiki page, with: {banner zone=AdSenseSkyscraperWide} (or whatever you called your banner zone). ! Template file (.tpl) method __General tip__: when inserting javascript in a tpl, do not use the tikiwiki template editor to modify the tpl, the javascript will be stripped for security reason. You need to use an editor outside tikiwiki. 1- Create a file called templates/mygoogleadsense.tpl and paste the code provided by google. {literal} and {/literal} makes sure that any javascript code doesn't conflict with Smarty code. {img src=images/code.png}%%% {CODE()} {literal} <!-- google_ad_client = "pub-00000000000000"; /* 468x15, created 06/02/08 */ google_ad_slot = "0123456789"; google_ad_width = 468; google_ad_height = 15; //--> {/literal} {CODE} 2- Create a ((module)) Name: mygoogleadsense Title: Advertisment Data: ~np~{include file="mygoogleadsense.tpl"}~/np~ {img src=show_image.php?id=95} 3a You can assign that module, as usual 3b or include in a wiki page {img src=images/code.png}%%% {CODE()} {MODULE(module=>mygoogleadsense, decorations=>n)}{MODULE} {CODE} ! Javascript module method -Tutorial from David Mattison This is a ((tutorial)) __note: I don't see how this can work as Google AdSense uses javascript and javascript it stripped for security reasons.__ (thanks to [http://www.davidmattison.ca/tiki/tiki-index.php?page=GoogleAdSenseInstructions|David Mattison]) Log in as the Admin or with Admin privileges to your Tiki Wiki. Open up the Admin menu so you can see all the options. Click on the Admin (click!) link at the very top, then click on the Features link. Make sure x HTML Pages is selected. Click Save Changes immediately below the top section of Features. Look at the Admin Menu again and select the Modules option. Select the Create new user module hyperlink at the bottom of the screen. The data fields are filled in as follows: Name = Google Adsense (or whatever you want to call the module — this name only appears in the Module section) Title = Google Ads (or whatever you want to call the module wherever it's displayed in your Tiki Wiki) Data = copy and paste the Javascript code from the Google Adsense site into this field You can modify the above parameters plus whatever new ones Google Adsense has developed. Click the Create/Edit button. Your new Module now appears at the top of the screen in the block title User Modules. PART TWO Now you have to Assign the module to a location and make it visible. Click on the "assign" hyperlink for your new Google Adsense module or select it from the dropdown list in the block titled Assign new module. You may need to play around with the Order, the Groups and the Visibility settings to get it to display at all times. I found that I often had to log out as Admin in order to see these module changes. PART THREE Good luck! PART FOUR If the above does not work and my good luck wish fails, as has happened with some others who've reported on their experiences to me, I'm afraid I don't have many suggestions to offer. One option you could try would be to create an HTML Page via the "HTML pages" option in the Admin menu. The trick would then be to get that HTML page into a narrow columnar block. Another option you could try would be the "Dynamic content" tool on the Admin menu. !Javascript module using literal tag Another alternative: use the smarty __~np~{literal}~/np~__ tag to "escape" the Javascript code from Google Adsense. This allows you to (nearly) simply cut/paste the code directly into a module. For example: {CODE()} {literal}<{/literal}script type="text/javascript"><!-- google_ad_client = "pub-00000000000000"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_type = "text_image"; google_ad_channel = "9238635124"; google_color_border = "006666"; google_color_bg = "EEF5EE"; google_color_link = "006666"; google_color_text = "000000"; google_color_url = "000000"; google_ui_features = "rc:6"; //--> {literal}<{/literal}/script> {literal}<{/literal}script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> {literal}<{/literal}/script> {CODE} Note the use of __~np~{literal}<{/literal}~/np~__ to escape the Javascript SCRIPT element.