PDA

View Full Version : need help with a google ad on my page....



ModernRevolutions
07-06-2008, 05:48 AM
I just got google adsense on my page but when you click the ad it opens it in the same window. Here is what the code is:
<script type="text/javascript"><!--
google_ad_client = "pub-1452497990472660";
/* 728x90, created 7/4/08 */
google_ad_slot = "0966636488";
google_ad_width = 700;
google_ad_height = 90;
google_ad_target = blank;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
any ideas?

allahverdi
07-06-2008, 06:49 AM
Please post a link to your site.

jscheuer1
07-06-2008, 07:04 AM
This line (if the Google script is following the generic nomenclature for this sort of thing):


google_ad_target = blank;

should probably be:


google_ad_target = '_blank';

allahverdi
07-06-2008, 07:11 AM
John,
That means it is google's mistake?

jscheuer1
07-06-2008, 11:49 AM
John,
That means it is google's mistake?

Assuming that's exactly the code the person got from Google, yes. However, the entire point of having a little script right on the page there is to allow for some configuration. And just to look at it, it's obvious (unless there is another script on the page before it) that blank is undefined.

It could be that the order of the two script tags needs to be reversed, but that would mean that blank is a variable in the global scope. I don't think even Google would be that arrogant, if you catch my drift. Though I suppose it is possible.

ModernRevolutions
07-07-2008, 09:02 AM
i just put in your code and it didnt work :/ here is a link to my site. http://www.modernrevolutions.net

jscheuer1
07-07-2008, 09:51 AM
As far as I can tell, there is no:

google_ad_target

in the pagead2.googlesyndication.com/pagead/show_ads.js file, so it wouldn't matter what it was set for. Ask Google. However, I suspect that their policy is to open their adds in the same window.

ModernRevolutions
07-07-2008, 11:37 AM
so there is no way for it to open in a new window? ok thanks anyway :)

jscheuer1
07-07-2008, 02:18 PM
so there is no way for it to open in a new window? ok thanks anyway :)

All I'm saying is that it doesn't look that way. I even looked at the pagead2.googlesyndication.com/pagead/show_ads.js file along with all the scripts associated with your page and with the inserted ads a bit more. Now, to have a new window, you need one of two things (in about the simplest terms):


window.open(URL)

or:


something = '<a href='+URL+' target="_blank" . . .

The scripts are condensed - use many one letter variables to represent things. But to get those, the things represented must be mentioned at least once in the scripts. There is no open and target is mentioned only once, hard coded to "_top". That makes me think even more that these scripts just weren't written to support new window.


Google would be your best resource on this though. I am assuming you signed up to participate in the this advertising program of theirs. If so, there must be a TOS page, probably a FAQ's page, probably a forum specifically for it, perhaps even an email address you can submit questions specifically about it to.

jscheuer1
07-07-2008, 02:37 PM
OK, it cannot be done (from https://www.google.com/adsense/support/bin/answer.py?answer=48182&sourceid=aso&subid=ww-ww-et-asui&medium=link - Google AdSense Program Policies):


Webmaster Guidelines

AdSense publishers are required to adhere to the webmaster quality guidelines posted at http://www.google.com/webmasters/guidelines.html.
Site and Ad Behavior

Sites showing Google ads should be easy for users to navigate and should not contain excessive pop-ups. AdSense code may not be altered, nor may standard ad behavior be manipulated in any way that is not explicitly permitted by Google.

* Sites showing Google ads may not contain pop-ups or pop-unders that interfere with site navigation, change user preferences, or initiate downloads.
* Any AdSense code must be pasted directly into webpages without modification. AdSense participants are not allowed to alter any portion of the code or change the behavior, targeting, or delivery of ads. For instance, clicks on Google ads may not result in a new browser window being launched.
* A site or third party cannot display our ads, se . . .