$Revision: 1.34.2.10 $ $Date: 2006/07/22 13:09:42 $
I've set up the Google Adsense module, following the help instructions. I created a single line text field in the User 1 profile, called "Google Adsense Client ID" and a form name of "profile_google_adsense_client_id"
I entered my Google adsense ID in the following format: (9's represent numbers)
"pub-9999999999999999"
BUT, when I go to admin-settings-adsense, I get an error message saying:
There is no site owner Google Adsense Client ID defined. Please define a profile field, and select it below as per instructions, and enter a value for user id 1 as explained below.
The required parameters field is correctly set to the field "Google Adsense Client ID"
Comments
Comment #1
kbahey commentedYou are running the same version that I am running on several sites, and it is the latest 4.7 version too.
What is the settings for the profile field you created? is it "visible only to modules" or "visible to priviliged users"?
Did you save the settings after selecting the profile field you created above?
Comment #2
zoon_unit commentedThe google client ID field is set up properly. The problem appears to be that the profile field value is not being saved into the mysql table "profile_values" However, when I revisit user-profiles and check the field, there is a value stored in it. So I'm assuming that Drupal caches field values somewhere?? If that is the case, then the problem lies with the fact that adsense retrieves the client ID directly from the mysql table, rather than from cache. (assuming there is a cache. if there's not, then I have no idea where the new profile field value is being stored)
I managed to get adsense to work by manually adding the value into the mysql table, but that is obviously a concern for a production site.
Comment #3
kbahey commentedAre you sure it is setup as : "Private field, content only available to privileged users"?
There is no caching in profile that I am aware of, and even if it had that, the field would be in the database then cached somewhere else.
The only way I know of where you would end up with this situation, is if you set up the field as "Hidden profile field, only accessible by administrators, modules and themes." THIS WILL NOT WORK.
Comment #4
zoon_unit commentedWell, as a matter of fact, that is exactly what I've got it set for. :-) I'm only using the adsense profile field for the admin, not users, so I assumed that was the correct setting. Based on its description it SOUNDS like the proper setting. And I am seeing an actual field with a value stored in it.
I will go back and experiment, but I still don't see how using that setting would prevent the field from being stored in the profile_values table. Is there another "hidden" field table I don't know about? (I'm using phpmyadmin for table access) If this is indeed the problem, you might want to add some additional clarification in the help.
Comment #5
kbahey commentedYour assumptions is incorrect, and that explains it.
The hidden profile fields are stored in the user (or was it session?) and not in the profile tables.
Therefore, it will not work.
I will add a note in the help about that.