2011-02-03 104 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。