Targeting the right content with Google AdSense for obtaining ads that are relevant to your visitors can make the difference between having ads that do little more than take up space on your site and having ads that achieve a good click-through uptake by visitors to your site.
Typically, mediabot scans a whole site to extract the keywords its algorithm identifies as being important. If your site is keyword-rich and all content is relevant you may already be seeing ads that are relevant to your site and visitors. If you have ever wondered why seemingly non-related ads are appearing then you need to give Google's AdSense mediabot a helping hand.
Just a few comments within your template's index.php file are all it takes to focus mediabot on the right content. Let's take a typical Mambo template. The main content is contained in this PHP call:
<?php mosMainBody(); ?>
If your content is well-written and contains your keywords then this is the area you will want mediabot to extract its AdSense keywords from.
Open up your template's index.php file and locate the mosMainBody tag. We will add comments directly above and below this. Like this:
<!– google_ad_section_start –>
<?php mosMainBody(); ?>
<!– google_ad_section_end –>
This tells mediabot to start indexing for AdSense at the start of the main content of your site (the content you add through Mambo) and to end its indexing at the end of this content.
If you have comments enabled on your Mambo site you won't want these used to build results for AdSense. Unfortunately, the inbuilt Mambo comments system inserts comments within mosMainBody. So, to make sure mediabot ignores the keywords within comments you will need to hack the core code.
To do this, locate the file called moscomment.php which is in mambots ->content.
Due to changes across versions of Mambo, I cannot give you the exact lines in which to place your code, but start by looking for this comment in the file, at around line 35 (depending on which version of Mambo you are using):
//Check if valid user
Just under this comment the code for adding the comments to your site starts. Look for the HTML that starts the output. eg.
$comments = "\n<div id=\"comments\">\n";
Insert a new line underneath and add this code:
$comments .= "<!– google_ad_section_start(weight=ignore) –>\n";
This tells mediabot to ignore any content that comes after this. Now we need to tell Google's bot where it needs to stop ignoring content.
Scroll down the moscomments.php file until you find the closing HTML tags. It will most probably be this:
$comments .= "</div><!--comments-->";
Create a line directly above this and add the following:
$comments .= "<!-- google_ad_section_end -->\n";
That's it!
NOTE: Make sure the content you are focusing on is keyword-rich and relevant. Google can, and does, penalise sites that abuse these tags.







