大家好
我已经创建了一个完全基于AJAX的Web应用程序,但是Adsense似乎无法为AJAX交付的内容生成任何相关的广告。

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

这是一个例子:

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>


已加载到iframe中:

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


谁都知道为什么我仍然没有收到任何相关广告。这种方法从一开始就存在缺陷吗?

谢谢。

最佳答案

这是一篇似乎解决了问题的有趣的讨论。

Adsense in iframe ?

注意:我还没有尝试过,尽管那个家伙说他是Google提出的这个解决方案,但是我会邮寄给他们,因为至少我不知道它是否违反了TOS

关于ajax - IFRAME中的Adsense,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4892758/

10-12 13:11