Forum Moderators: martinibuster
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?
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.
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.
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;
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.
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.