I saved adsense code as html ad via "php filter". Added a block to page footer via Blocks menu. Tried all display types, but all of them have problems.

1) JavaScript: Ad placement is wrong in IE. Ad is shown under the dedicated box for showing the ad. Firefox's ad placement is OK. Firefox shows the ad, but throws the error "Security Error: Content at http://googleads.g.doubleclick.net/ may not load data from http://www.mydrupalsite.com." in the error log. When I try to edit the advertisement node for adsense, IE shows the editing page properly, but Firefox shows only a whitescreen.

2) jQuery: Only shows an URL instead of the ad

3) IFrame: Frame size does not fit to ad size. Also I suspect it is not allowed to show Adsense ads inside IFRAME. It looks against the TOS of Google.

3) Raw: Does not show anything. I do not use drupal caching or the cache inside the module. Clearing cache via Performance menu does not make a difference.

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

Raw was broken in -beta5, but should be functional in -beta6. Have you actually re-tested this with -beta6? If not, please retest and confirm that all of these problems still exist for you.

mcload’s picture

Version: 6.x-2.0-beta6 » 6.x-2.0-beta5
Status: Postponed (maintainer needs more info) » Active

Report was for beta5. Now, updated to beta6 and tried raw mode again. It looks like main problem is solved. I can see the google ads properly under IE and Firefox in the raw mode. However, one problem is still there. When I try to edit the advertisement node for adsense via node/11/edit, IE shows the editing page properly, but Firefox shows only a whitescreen of death. Firefox first starts to render the editing page, but then moves to blank page and writes "Loading" at the page tab infinitely.

jeremy’s picture

Version: 6.x-2.0-beta5 » 6.x-2.0-beta6
Status: Active » Postponed (maintainer needs more info)

In -beta6, do any of the other display methods work other than Raw? If not, it's likely a script within a script issue.

As for your white screen, review your Apache error_log -- what errors show up when you get the white screen?

mcload’s picture

Now checked the apache error log. There is no related error in the log. However, Firefox error terminal shows this error. Maybe they are related.

Error: window.google_render_ad is not a function
Source File: http://www.mydomain.com/adru/node/11/edit?destination=admin%2Fcontent%2Fad
Line: 0

jeremy’s picture

Are you still getting the white screen? And nothing shows up in your error log? What do you see if you "view source" on the white screen?

mcload’s picture

Updated to RC1. Still getting white screen problem. No error is shown in the server error log. "view source" on firefox does not show anything. Only a white screen.

ufku’s picture

I had the same issue when i was trying to wrap all block content using jquery. I think this is expected when js manipulates content that has js in it.
Might moving the src script to the header or footer help?

lonepie’s picture

A temporary fix is to disable javascript when editing the Ad node.

I went a step further and altered ad/html/ad_html.module, changing line 131 to the following:

'#value' => strstr($node->html, "google_ad_client") ? "<strong>Google AdSense Ad Preview Disabled</strong>" : ad_html_display_ad($node),

This way, all AdSense ads should have their preview disabled (I don't really need to preview the AdSense ad anyway).

jeremy’s picture

jeremy’s picture

arthursk’s picture

lonepie, thanks for the handy fix, this works well and is logical.

lrwebks’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

Drupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!