By TooFatToFish on
I'm very new to Drupal (coming from Wordpress), and I'm trying to set up this Google Ad manager module (http://drupal.org/project/google_admanager) to work.
I just don't understand this part:
Add the following code in template.php file or adjust _phptemplate_variables($hook, $vars) if it's already in
<?php
function _phptemplate_variables($hook, $vars) {
if ($hook == 'page') {
if (module_exists('google_admanager')) {
$vars['scripts'] .= google_admanager_add_js();
}
return $vars;
}
return array();
}
?>Can you help?
Comments
that means that you need to
that means that you need to edit your template.php in theme directory (suppose you're using garland theme then it would be at themes/garland )
You'll found template.php in that.. If it is not there in your theme you can create one.
You need to add above code in your template.php file, that's it.
In case _phptemplate_variables function already there then you need to add this code inside that function.
Hey, thanks for the
Hey, thanks for the reply.
This is my template.php file:
Where would I put that code in here?
Help please
Help please
just at the bottom
just at the bottom
Thanks daniel. After ?>
Thanks daniel. So put it after the
?>line?Yep
Yep
Founder @ Glass Analytics
Ad Slots
Please explain what goes into the Ad slots: (Enter one Ad Slot name per line.) Is this free-text, like the name or ID# on Google's Manage Ads webpage, or is it something specifically related to my AdSense account and the ads I want displayed in this slot?
In your Google AdManager
In your Google AdManager account, you have created the ad slosts you wished to fill on your website.
The names of these ad slots must be entered in the "Ad slots" field of the module in Drupal (one per line).
Once it's done and saved, you have one block per slot on your block management page, which you can move to any region of your pages.
Your AdSense unit code
AdSense provides a block of javascript unit code for each AdSense unit. Is this code needed? If so, where should this code be entered in Drupal?
You don't need to put the JS
You don't need to put the JS code from Google AdManager in your code: this code is automatically generated by the module once it is activated and you have some ad slots on your pages.