2011-02-03 102 views
3

嘿人, 我已经创建了一个完全基于AJAX的网络应用程序,但是AdSense似乎无法为AJAX提供的内容生成任何相关广告。AdSense in IFRAME

为了显示相关广告,我创建了一个I-Frame,它将显示一个缓存文件,其中包含以html格式存储的AJAX提取内容的硬拷贝,并在其中包含adsense.js脚本。

下面是一个例子:

<iframe src="adsenseexample.html"> </iframe> 

有人知道为什么我还没有得到任何培训相关的广告:这是加载到一个iframe

adsenseexample.html 


<html> 
<head> 
<title>User Cache</title> 
</head> 
<body> 
<div style="height:200px;"> 
<script type="text/javascript"><!-- 
google_ad_client = "ca-pub-xxxxxxxxxxxxxx"; 
google_ad_slot = "xxxxxxxxxxxxx"; 
google_ad_width = 200; 
google_ad_height = 200; 
//--> 
</script> 
<script type="text/javascript" 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
</script> 
</div> 
(This is where the cached content is. It's not visible to the user but 
a complete duplicate of what they are viewing. It's in 
plain text with no pictures for faster loading). 
</head> 
</body> 

。这种方法是否有缺陷?

谢谢。

+0

等,所以广告显示出来,但他们似乎不相关? – Trufa 2011-02-03 23:02:50

回答

2

这是一篇有趣的帖子,似乎已经解决了这个问题。

Adsense in iframe ?

注:我没有尝试这样做,虽然这个家伙说他这个解决方案提出了由谷歌,我会邮寄他们,因为至少我无法弄清楚它是否或不违反TOS

0

嗯,你有没有尝试传递params到你的iframe src,如关键字,介绍http请求的描述?然后您将想要将关键字参数和描述添加到元标记。

-1

Google在其ToS中声明IFRAMES不适用于AdSense。