Is it legal to have adsense ads in iframe ?
The terms only mention that you cannot frame your visitors after they click on an ad link and in the policies state that no Google ad may be placed on any non-content-based pages.
If you put the ads in iframe then probably they won’t find any content in order to serve any relevant ads. But, what if you make the ads look outside of the iframe ?
document=parent.document;
I don’t think it would violate their terms and conditions but to be sure I send an email to the adsense team:
To the Adsense Team,
I have looked in your terms and the policies on the adsense help site
but I can’t seem to find this info anywhere.I have a site with a very old CMS installed on that does not let me
use anything other than iframe to display the ADS, changing the whole
CMS was out of the question, so I thought about the following solution
with my little experience with javascript.I would put the following code in a html page and then I would call
this page within an iframe in my existing CMS
<script type="text/javascript"><!-- document=parent.document; //--></script> <script type="text/javascript"> <!-- google_ad_client = "pub-xxxxxxxxxxxxxxxxxxxxxx"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel = "xxxxxxxxxxxxxx"; google_color_border = "FFFFFF"; google_color_bg = "E6E6E6"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "008000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
the first 3 lines of this code make the parent document available to
the google script so essentially I am bringing the google ad code out of its iframe
borders in order to find content and serve relevant content.Would the following code be considered code modification under the policies ?
In terms of functionality I tested it and it works, I am going to wait
for your comfirmation in order to use it.
And their answer was:
Hi Giorgos,
Thanks for your message. We apologize for our delay in responding to your
mail.Please note that you are free to add HTML code or javascript in front or
below the AdSense ad code as long as you do you change the ad code itself.Your suggested solution therefor complies with our program policies.
For additional questions, I’d encourage you to visit the AdSense Help
Center (http://www.google.com/adsense_help), our complete resource center
for all AdSense topics. Alternatively, feel free to post your question on
the forum just for AdSense publishers: the AdSense Help Group
(http://groups.google.com/group/adsense-help).Sincerely,
Pim
The Google AdSense Team
10 responses so far ↓
1 Sami // Jul 10, 2007 at 1:11 pm
But what about…
“No Google ad may be placed on any non-content-based pages.”
..and..
“No Google ad may be placed on pages published specifically for the purpose of showing ads, whether or not the page content is relevant.”
Isn’t the page that’s displaying the ad described perfectly by these two points?
Plus, yes, you seem to be covered for the not altering the code, but what about “or change the behavior, targeting, or delivery of ads”
To me this clearly is behavior altering.
2 GiorgosK // Jul 10, 2007 at 1:17 pm
Well the answer came from adsense support, so I am completelly covered, if you have a similar situation write an email to google support.
3 Nick // Feb 27, 2008 at 4:24 am
What if I want to do the opposite?
I have a page that has very little content. This is where the ads are located. But the content (blog) is on the same page within an iframe. I want the ads to use that content so the ads and the blog, which appear on the same page in the end, to match. Is there code that will actually point it to the iframe source?
4 GiorgosK // Feb 27, 2008 at 8:45 am
Nick
I assume the content in the iframe is not on “yourdomain.com” and therefore the content cannot be accessed using javascript or any other means unless the source iframe includes
<script type=”text/javascript”>
document.domain=”yourdomain.com”;
</script>
Thus I would try to just include a relevant enough title on the parent so the adsense can read that and serve related ads.
And as far as I know this is not forbidden by google
5 AndyH // Mar 17, 2008 at 7:31 pm
Hi,
I wonder if you can help.. I just came across this post and it seems very similar to my problem.
I have the advert in an iframe which has relevant information - but with the standard code it’s looking at the parent document which I don’t want it to do as it’ll come up with competitor adverts.
Can I get it to ignore the parent?
Cheers.
6 GiorgosK // Mar 17, 2008 at 8:43 pm
If I understand correctly there is a page (the parent) and inside it you have an iframe (lets call it relevant) with relevant content in which you have the adsense code right ?
well adsense has its OWN IFRAME which is created with javascript. The adsense will actually be looking IN THE RELEVANT IFRAME. and therefore you don’t need to worry about a thing …
7 AndyH // Mar 17, 2008 at 9:43 pm
I think it also looks at the referrer so I’ve put it in an iframe, in an iframe on a different site and it seems to work how I want it to now
8 Olaf // Mar 18, 2008 at 1:32 pm
I think using an iframe around the add code is very good solution because often the adsense server is very slow and your site could act slow too (depends on where the add code is placed).
I think it’s important that you never cheat, if you use that iframe to organize your ads for the same page/site it should be OK.
btw. There are a lot of revenue sharing sites using some iframe…
9 TR // Mar 23, 2008 at 2:47 am
No Google ad may be placed on pages published specifically for the purpose of showing ads, whether or not the page content is relevant!?
10 GiorgosK // Mar 23, 2008 at 2:56 am
What is your point ?
Google did give permission to do so !!
Leave a Comment