Loading...
 
Skip to main content
How to Add Google AdSense to your Tikiwiki site


Please see: Module Google AdSense

Banners method

Create a banner

  1. After enabling the banners feature, go to Admin > Banners.
  2. Click on the Create banner button.
  3. In the Zone section, create a new zone by typing a name (perhaps "AdSenseSkyscraperWide") in the zone text box, then click the Create button.
  4. The page will refresh. Return to the Zone section and select your new zone from the pulldown menu.
  5. Further down on the page, in the HTML code text box paste the code which AdSense gave you.

Use in a module if desired

  1. Go to Admin > Modules.
  2. Click on the User Modules tab.
  3. In the Create a new user module section:
    1. Type in a module name, such as 'AdSenseSide'.
    2. Type a title ('Ad'?) or a space if you want no title (or you can later use the 'notitle' parameter on the module).
    3. 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.
    4. Click the Create button.
  4. Click on the Assign/Edit Modules tab.
  5. In the Assign new module section:
    1. Select your newly created module in the Module Name pulldown menu.
    2. Select a Position (left/right) and Order to indicate the location.
    3. In Groups use Control+Click to select any desired groups (probably Anonymous and Registered).
    4. Use Preview if desired. Remember to click Assign to save your work.


The banner can be inserted in an Admin > Look & Feel section, or in a Wiki page, with: (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.

Image
Copy to clipboard
{literal} <!-- google_ad_client = "pub-00000000000000"; /* 468x15, created 06/02/08 */ google_ad_slot = "0123456789"; google_ad_width = 468; google_ad_height = 15; //--> {/literal}


2- Create a module

Name: mygoogleadsense
Title: Advertisment
Data: {include file="mygoogleadsense.tpl"}

Image

3a You can assign that module, as usual


3b or include in a wiki page

Image
Copy to clipboard
{MODULE(module=>mygoogleadsense, decorations=>n)}{MODULE}


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 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 {literal} 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:

Copy to clipboard
{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>


Note the use of {literal}<{/literal} to escape the Javascript SCRIPT element.


Created by mlpvolt. Last Modification: Friday 26 July, 2019 12:58:16 GMT-0000 by Yves Kipondo.