【发布时间】:2011-06-21 00:51:14
【问题描述】:
大家好, 我创建了一个完全基于 AJAX 的网络应用,但 Adsense 似乎无法为 AJAX 交付的内容生成任何相关广告。
为了展示相关的广告,我创建了一个 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>
任何人都知道为什么我仍然没有收到任何相关的广告。这种方法从一开始就有缺陷吗?
谢谢。
【问题讨论】:
-
等等,广告正在显示,但它们似乎不相关?
-
是的,就是这样。例如,我创建了一个测试帐户,其中包含由 AJAX 提供的有关计算机/技术的内容。就像我上面解释的那样,adense.html 将包含所有内容的纯文本版本并加载到 IFRAME 中。不幸的是,我收到的广告似乎是基于非 AJAX 交付的内容(如网站名称),而不是相关广告。