Forum Moderators: martinibuster

Message Too Old, No Replies

Breaking out of frames

A way to break out of frames that is compliant to the TOS?

         

vredungmand

12:48 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Does anyone know a good way to break out of frames that is compliant with the Adsense TOS?

I have a large chunk of traffic comming from a site that has my site in a frame with banner ads on top and bottom. The linking in frame causes Adsense to display PSAs.

I have tried <meta http-equiv="window-target" content="_top"> but it does not work.

After email conversation with Google I removed a javascript version (that worked). It was against the AdSense TOS:

function break_out_of_frame() {
if (top.location!= document.location) {
top.location.href = document.location.href;
}
}

..

<body onload="break_out_of_frame()">

Any suggestions?

bird

12:53 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It was against the AdSense TOS:

Where do the AdSense TOS say that I can't have my pages break out of someone else's frames?

vredungmand

1:15 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Not there in precise words.

The quoted Javascript might cause a double hit in Google's stats. So I emailed support and asked if it was a problem and it was.

I don't how much of the correspondence I am allow to post?

Can I quote their reply to me here? Or would I have to rephrase?

Sharper

3:27 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



See if you can write something that triggers earlier in the event chain, before the adsense js is run?

bird

3:44 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The quoted Javascript might cause a double hit in Google's stats.

So what?
The page *is* loaded twice, and for very legitimate reasons. There are thousands of sites with AdSense out there that employ similar frame busters, and I haven't heard of anyone running into trouble because of that.

So I emailed support and asked if it was a problem and it was.

I can't see a good reason why it should be considered a problem for them. Maybe the person answering you was just overly cautious?

Can I quote their reply to me here? Or would I have to rephrase?

Please rephrase.

vredungmand

6:15 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Part of this is possible due to a misunderstanding or me failing to explain properly. Anyway it ended in a clear "remove your script - thank you".

I don't know how rephrase it without make it sound like nonsense. But it was something like: changing the advertisement to open in a new window is against the TOS. Please remove it.

I gave support an exact URL and asked them to inspect the code. I said of the explicit points listed in an email to me, I considered that the script was in compliance with the TOS.

I asked them to reconsider - but they did not.

Do you know of examples of compliant websites that have a break out of frame script? Can you point me to an url?

Any general advice on handling this situation: Should try to email support again? This was 2 months ago.

vredungmand

6:17 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



One temporary way of getting around the situation is to move the page and then having a script (without ads) that breaks out of any frame and then forwards to the new location.

Jenstar

6:34 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem AdSense must have had is that some frame breaker scripts cause the AdSense ads to reload more than once per page (because it is in an iframe) and sometimes keep loading continuously until the visitor leaves the page. Obviously, this will cause a lower CTR, and it could be abused by people trying to hide an otherwise higher CTR rate.

If you are having problems with relevant ads due to the frame issue, you can check off the framed content box when getting your AdSense javascript code.
[google.com...]

You could also do a "Click here if you are stuck in frames" link that people could click to get out of the frames.

There was also a message by bird last summer that says this works for a frame breaking script:

function l(){
if(parent.location&&parent.location!=window.location){
top.location=window.location;}}
window.onload=l;

[webmasterworld.com...] msg # 37

Perhaps AdSense will give you the stamp of approval for that one - I would definitely advice getting permission before you use it though, since they have already warned you for using a different version.

vredungmand

6:57 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Good idea. It seems like ticking "Ad will be placed on a framed page" will generate non PSAs. Though - not the best solution - some people will still be getting a framed site with banners.

digitalv

7:00 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A little bit of Javascript could be written to DETECT if the page is being loaded in a frame. If yes, then redirect to a target="_top" page. Bye bye frames.

vredungmand

7:04 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



BTW. Would this be ok w.r. to the TOS? I mean: I tick the option so I will make money of something that is in clear violation (banner framing ...).

vredungmand

7:05 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



digitalv: That is exactly what the function break_out_of_frames does.

bird

3:17 pm on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



changing the advertisement to open in a new window is against the TOS. Please remove it.

This is NOT what the script snippet in your first post does. Someone at Google must have had a really bad day confusing the two things. You may need to call them and ask for someone who actually understands the technical issue at hand.

There was also a message by bird last summer that says this works for a frame breaking script

My snippet in that thread is exactly equivalent in its effect to the one given by vredungmand in the first post of this thread.

A little bit of Javascript could be written to DETECT if the page is being loaded in a frame.

That's exactly what the two snippets presented so far do.