I have setup 3 new Drupal sites with the latest version; I have installed and setup both the stable and dev version of adsense; as you can see from all three sites; no ad; I don't see the javascript for the ga in the page source. My Status report is clean.
All sites are running off the same server; I have all three setup with the same ga account; I tired a few slots; which is working with the Binary Bit Google Ad module (http://binarybit.com/joomla-demo/joomla-modules/google-adsense.html) I wrote for Joomla at this site http://aspiremortgage.net/
Running Dev
http://demo.binarybit.com/
Running Stable
http://aspiremortgage.org/
http://aspiremortgageco.com/
At http://aspiremortgage.org/ and http://demo.binarybit.com/ (now running dev) I got this error with stable version; note that I don't get this error at aspiremortgageco.com
* warning: include_once(sites/all/modules/adsense/managed/help/adsense_managed.help.inc) [function.include-once]: failed to open stream: No such file or directory in /home/aspiremortgage.org/public_html/sites/all/modules/adsense/managed/adsense_managed.admin.inc on line 18.
* warning: include_once() [function.include]: Failed opening 'sites/all/modules/adsense/managed/help/adsense_managed.help.inc' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/aspiremortgage.org/public_html/sites/all/modules/adsense/managed/adsense_managed.admin.inc on line 18.
I have cache disabled.
I have it installed in /sites/all/modules/adsense
Very strange knowing that this module appears to work fine at your site.
I didn't try to debug, I'm also a PHP programmer as mentioned above.
Let me know what other information you need.
Comments
Comment #1
jcnventuraCan you see if the adsense_managed.admin.inc file is located in /sites/all/modules/adsense/managed ??
Your download may be corrupt for some reason and that file failed to deploy. Usually the fix is to download it again.
João
Comment #2
jflesher commentedThis is the path I have to the file:
/sites/all/modules/adsense/managed/adsense_managed.admin.inc
For both dev and stable.
at am.org error but not am.com
mod_fcgid: stderr: PHP Fatal error: Call to undefined function adsense_managed_help_text() in /home/aspiremortgage.org/public_html/sites/all/modules/adsense/managed/adsense_managed.admin.inc on line 29
Which is this line
'#value' => adsense_managed_help_text(),
I get this error when I click on /admin/settings/adsense/managed (I get a blank screen also)
I'll use these two sites to debug with; but have the stable version; I can install the dev on one; but this will give you a chance to see why one has errors and one doesn't; both do not display ad.
Where do you call the javascript at?
I did download and test archives and deleted FTP folders and reuploaded them. No help.
Comment #3
jflesher commentedI did a little poking around your sites and found this:
http://baheyeldin.com/drupal/drupal-module-google-adsense.html
Found the symptom
Submitted by Anonymous (not verified) on Wed, 2007/04/18 - 11:42.
Using Firefox's Firebug, I can see that the JavaScript to inject (pull) the ads from Google and place them in the box is missing. Hope this helps.
It seems this is a very old problem; I started playing with settings and I got it to work on one site so far; it seems like it has something that isn't being set; you should do a fresh install and run a debugger on it; step each line of code; look for things not getting set correctly; this is a bug; its gong to be hard to find without a line by line debug.
Comment #4
jcnventurajflesher, I don't think that you can find the source of your problem with Firebug..
The problem is that your site can't find a function that is perfectly defined on a file which is in your system, and that works perfectly for 4999 other users.
So the problem is: what in your site is preventing the use of those functions? Is it only the managed ads module? Can you try to setup the old code module and see if that gives you problems also? I am thinking maybe your PHP installation has some kind of filter which is preventing those files from being used.. Maybe it's matching something on managed or something...
João
Comment #5
jflesher commentedIf it was only me I'd say ok; but you have numerous others with the same problem; and it seams you give them them this same speech; which means you never get this problem and can not duplicate it.
As I have stated; after bouncing around it finally started to work; don't know why; my best guess is that somewhere in the code it finally set something that was needed and has worked fine ever since.
I wasn't my ads; they have ran for over a year; its not GA I have a module I wrote for Joomla that works fine all the time.
I repeated this for 4 installs on 4 different sites; I'm sure I put in the right numbers since I didn't change them again and eventually it did start working; after a few hours. Saying it works fine for the other 4999 users is fine; I agree; you can now add me to that total for an even 5,000; but not until you admit that the install has an issue sometimes; maybe rare, but it happened to me and others like me; so its a problem; duplicating it will be hard; firebug isn't the tool to use; you need to first duplicate the issue on a machine; then use a real PHP source code debugger to step thru each line of code and find out what's going on; I have a feeling that you'll find it if you just step thru each line once and pay attention to what's going on, I didn't look at the code, so I don't have any idea; if it continues to be a problem for me, I'll break out my Nusphere's PHP Ed and figure it out and let you know, I'll try to make time to do this, it would be worth it to me, (after I figure out an issue that may stop me from using Drupal for my project, in which case I'll have to start looking for another CMS); otherwise this will continue to be an issue for some installs at least; that is all I'm saying at this point.
You can tell people if the ad doesn't show up right away to give it time; maybe a few hours; this is acceptable for me, it worked eventually; I don't know; is this normal?
At this point I'd say this is a very minor problem / bug, and may not be worth debugging; once it started working it never stopped again.
I can duplicate this on my machine; every install does it. I'm running CentOS 5.3 x64 using install script from Virtual Min.
Great module and thanks
Comment #6
jcnventuraNice to know it's working for you now.
I find it strange that you get the idea that this is a problem that occurs often to others which just gets dismissed. I remember similar situations, but usually it's either a corrupt download or the user doesn't transfer the files correctly and omits the directory structure.
Anyway, you're right. I can't reproduce it. If you're able to reproduce it everytime, and you're able to pinpoint the source of the problem, I'd love to find out what it is so that it can be fixed. Unfortunately, looking at the code, it's simply a case of one line:
I have tried looking at the code, and simply said, there's nothing to debug there.
João
Comment #7
jflesher commentedThese may not be related to my problem but they do need to be resolved.
$Id: adsense_click.logs.inc,v 1.1.4.2 2008/12/19 01:32:37 jcnventura Exp $
line 55 $path is not defined
// $Id: adsense.module,v 1.68.2.14 2009/01/23 00:28:33 jcnventura Exp $
line 201 $major, $minor is not defined
Comment #8
nancydruI am using this on a brand new 6.10 installation. It didn't work on 5.x, so I turned it off until I got to 6.x. I downloaded the module yesterday and put it into a completely empty directory. I am not able to do a line-by-line debug. If you give me some idea of things to look for, I will be happy to do that.
When I am logged in as user/1 all I see is a placeholder box. When I log out, I get a public service ad. I double checked my pub code and it is correct. I also checked my slot id and it is correct.
Comment #9
jflesher commentedI understand about not having a debugger to run it line by line; right now I have the same issue in Fedora 10; I can't get the debugger to work in Eclipse; I can jump back to windows where my debugger is working; I just hate windows is all; but I did find that if I set the Enable test mode that sometimes it will start working; not always; but I do always eventually get it to work, so its not that big of deal.
Once I get my debugger working I'll step thru it and find out why this is happening and let you know.
I didn't know if the errors I reported had anything to do with it; or if they are errors; some programmers like to not define variables and then check to see if they have been set with isset; I think this is a bad idea; if it looks like a bug it might turn into one; set the variable with null or false then check to see if its still null or false is a better way to do it, the correct way in fact. I would look at these two lines and see if fixing them solves the problem; I think its worth looking at, otherwise I wouldn't bother you with it. Its clear that something isn't being set correctly; once it is then it works fine; I verified this on another server.
Thanks
Comment #10
nancydruThere are cases wher I disagree with your "isset" idea, but this is not the place to discuss it.
I simply do not have a debugger, nor do I have the time or money to install one and try to learn it.
If it helps any, I think I also tried posting the Google script code into a block and that did not work either.
Comment #11
kbahey commentedIf the Google code pasted in a block AS IS does not work, then the problem is from Google's side.
The only thing to check is that the code generated by the adsense module is the same as the one in your adsense account at google.com. If they are, then there is no much to do other than wait.
Google often takes its time with new sites until they are indexed before they push ads to them.
Comment #12
nancydruThe site is not new, just the ads. The site has been up for two years or more.
Comment #13
jcnventura@NancyDru: Google uses a separate spider for the ads, which only indexes your site after you sign up to AdSense.. You may have to wait for them to index your site before ads start showing.
@jflesher: I haven't had time to check the adsense_click warning, but the other one is strange: the $major and $minor variables there are parsed from Drupal's version string. In every version I have tested up to now, these have never been undefined.. The question is: what version of Drupal are you running?
Comment #14
nancydruHmm, I signed up for ads many months ago when it was still on 5.x and they never worked under 5.x so I turned the module off. Do they only index when I leave an empty block up?
Comment #15
jcnventuraBetter ask them yourself, why your ads are not showing.
Comment #16
jflesher commented@jflesher: I haven't had time to check the adsense_click warning, but the other one is strange: the $major and $minor variables there are parsed from Drupal's version string. In every version I have tested up to now, these have never been undefined.. The question is: what version of Drupal are you running?
One thing about PHP; it has a lot of features like basic; for example sscanf(VERSION, "%d.%d", $major, $minor); it will create the variables if they do not exist; or fill them if they do.
$major, $minor do not exist prior to this command running; therefore they are undefined; after running they are defined
if you define them prior to this; like so:
$major=0;
$minor=0;
sscanf(VERSION, "%d.%d", $major, $minor);
You will not get this warning when running test against the code. This is a best practice; even though the examples of its use do not show this
Either way is still correct in PHP and was not causing any problems.
But by defining them first you do not get a warning and I would say its more correct.
I should have looked at the code before posting this; sorry; lazy on my part; but if you define them the warnings will not show up and look cleaner and more professional.
This module is working great once the settings take; thanks for your hard work.
Comment #17
jcnventura@jflesher: I never got any warnings from PHP and I run my test Drupal with all warnings enabled.. What tool are you using that is issuing those warnings?
Comment #18
jflesher commentedJust to clarify for NancyDru about settings:
Make sure you enter the ID here admin/settings/adsense/publisher in the format pub-9999999999999
Check enable test mode under advanced here admin/settings/adsense
In the block to display the ad here admin/build/block/configure/adsense_managed/0 (0 may differ for you) but make sure the ad slot ID is in the format 0123456789
Make sure you pick the correct ad format for this slot
You should be able to see the block and compare the code in it with the code Google Adsense gave you at their site.
Google will give you the code to cut and paste it; if you are still having problems; paste that code and the code at your site that shows up in the block here and we can help you a little more.
Comment #19
nancydruI did cut and paste the two IDs directly from the Google site. The ad formats allowed by teh module do not coincide with the formats that Google shows; I used the closest match. As I mentioned above, I did also try pasting the code from Google into a block and that did not work either.
I have not tried enabling "test." What will that show me so that I can recognize that it's working?
Comment #20
jcnventura@NancyDru: what do you mean the ad formats allowed by the module are not the formats that Google shows? They're an EXACT match.. Can you please elaborate on that?
Also, can I take a look at an ad in your site that is being created by the module? Please provide a URL (via PM) or post the code here..
João
Comment #21
nancydruWell, I went in to get the list of ad formats and saw a note that my account is on hold because I haven't entered a PIN that I never received.
You might want to mention this in the instructions, preferably in the settings page.
Comment #22
jcnventuraI'm closing the issue as there has been no news in this thread for more than two weeks. I've written a FAQ for the most common solutions to this problem.
Comment #23
nancydruIt did suddenly start working, although the direct script never did.
Comment #24
mustafa.ata commentedI am using drupal 7. The solution which worked for me is that I used the adsense tags format and then used this format to show ads on the site. Actually I was getting Ads disabled for admin and for other users i was getting the empty ad with space occupied on page but nothing shown. After different tweaks and experiments I got the following code working for me
[adsense:336x280:XXXXXXXXXX]
2nd parameter is width x height
3rd parameter: XXXXXXXXXX denotes the google ad slot/id.
I hope this will help others.
Ata ul Mustafa