大家好,我已经创建了一个完全基于AJAX的web应用程序,然而Adsense似乎无法为AJAX交付的内容生成任何相关的广告。
为了显示相关的广告,我创建了一个I-Frame,它将显示一个缓存文件,其中包含AJAX获取的html格式内容的硬拷贝,并在其中包含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>
有人知道为什么我还没有收到任何相关的广告吗?这个方法从一开始就有缺陷吗?
谢谢。
发布于 2011-02-04 07:06:12
这里有一个有趣的讨论,似乎已经解决了这个问题。
注意:我还没有尝试过,虽然他说这个解决方案是由Google提出的,但我会把它们寄给他们,因为至少我不能确定它是否违反了TOS
发布于 2013-02-03 15:01:57
嗯,你有没有试过从引用的http请求中给你的iframe src传递参数,比如关键字,描述?然后,您需要将关键字param和description添加到meta标记。
发布于 2014-04-19 01:44:26
谷歌在他们的ToS中声明,IFRAMES不能与Adsense一起使用。
https://stackoverflow.com/questions/4892758
复制相似问题