迫切需要一个与 Ajax 配合使用的 Adsense 解决方案
我知道这个问题已经很少次此处。但这些似乎相当过时,而且 Adsense for Ajax 项目似乎已经罐头(或者至少,移动非常缓慢)。
但 Adsense 无法与 Ajax 配合使用——至少在本地无法配合使用。我读过有关 iFrame 解决方案的内容,但听起来 iFrame 和 Ajax 以及我的 pjax 解决方案不能很好地协同工作。
就 Adsense 的使用而言,我所做的并不狡猾。当用户点击链接时,我仍然只是在每个页面导航中显示一组广告。它只是没有执行完整的页面级 HTTP 请求。
还有其他选择吗?有人做过这样的事吗?或者,有人知道 Adsense for Ajax 项目有任何更新吗?
我需要弄清楚这一点。如果我不能,我可能会选择 pjax 而不是 Adsense,这意味着我的整个商业计划将不得不重新考虑。啊。
提前致谢。
I know this questions has been asked a few times here. But these seem fairly outdated, and it looks like the Adsense for Ajax project has been canned (or at the very least, moving very slowly).
I have a web site that I've recently integrated pjax into -- basically, it uses Ajax to load the just the main content area, while maintaining the browser history and back/forward functionality using javascript's history.pushState
.It has made a world of difference in how responsive the whole site is, as it no longer has to do HTTP requests for all of the outer shell of the site (javascript, css, images).
But Adsense just won't work with Ajax -- at least not natively. I've read about iFrame solutions, but it sounds like iFrames and Ajax and my pjax solution won't play together well.
What I'm doing is not devious, as far as Adsense usage goes. I'm still just showing one set of ads per page navigation as users click links. It's just not doing a full page-level HTTP request.
Are there any options out there? Has anybody done something like this? Or, does anybody know of any updates to the Adsense for Ajax project?
I need to get this figured out. If I can't, I may chose the pjax over the Adsense, which means my whole business plan will have to be rehashed. Ugh.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
仅供参考,我联系了谷歌,并收到了以下回复:
虽然它相当模糊(这是我所期望的),但它至少表明他们认识到这种需求,并且没有完全忽视它。
感谢大家的回复。
FYI, I reached out to Google, and received the following response:
While it's fairly vague (which I expected), it at least shows that they recognize the need, and are not completely ignoring it.
Thanks to all for your responses.
这违反了 AdSense 条款。
您可能想要实施 DFP 解决方案,如果我记得确切的 DFP 允许类似的操作的话。
This is against AdSense terms.
You may want to implement the DFP solution, If I recall exact DFP allows something like that.
这是旧的,但我认为更新的答案可能会很方便。
Google 的广告管理器 DFP 现在支持刷新广告,这对 ajax 网站来说可能很有用。不幸的是,它们不支持移动广告,并且每次页面刷新时每个“插槽”只能使用一次,因此它仍然非常有限。
然后:
如果刷新相同的广告对您不起作用,目前最好/唯一的解决方案似乎是使用谷歌广告代码制作一个简单的 iframe.html 文件,并通过具有高度和宽度的 ajax 将其动态加载到 iframe 中放。我认为 Adsense 仍然足够聪明,能够根据上下文广告找出引用页面。
This is old but I figure an updated answer could be handy.
Google's ad manager DFP does now support refreshing ads, which is something ajax sites could find useful. Unfortunately, they don't support moving ads, and you can only have each 'slot' used once per page refresh, so it's still pretty limited.
then later:
If refreshing the same ad won't work for you, the best/only solution currently seems to be to make a simple iframe.html file with the google ad code and load that in an iframe dynamically via ajax with height and width set. I think Adsense is still smart enough to figure out the referring page in terms of contextual advertising.
解决这个问题的最佳方案是提供静态替代页面。如果您要推送历史状态,那么您必须已经想出一个 URI 方案来描述您网站上的“页面”。现在您所要做的就是向浏览器提供这些页面的静态副本,而无需使用 JavaScript。除了让 adsense 机器人看到您的内容之外,这也有利于 SEO,因为它允许 google 网络爬虫看到您的内容。
The best solution to this problem is to provide static alternative pages. If you're pushing history state then you must have already come up with a URI scheme to describe "pages" on your site. Now all you have to do is serve static copies of those pages to browsers without javascript. In addition to letting the adsense bot see your content, this will also be good for SEO because it will allow the google web crawler to see your content.
首先警告:Google 是无情的,如果您违反了其 TOS 中的技术细节,Google 不会与您讲道理。
除此之外,这个问题似乎与您的问题同义。我不相信从那时起 AJAX 广告有任何进步(HTML5 没有提供任何我能想到的解决方案......)
该页面的 TLDR 版本是:
鉴于谷歌烦人(且严格)的条款,我是否可以建议使用另一个广告网络
First a warning: Google is merciless and will not reason with you should you break even a technicality in their TOS.
That aside, this question seems to be synonymous with yours. I don't believe there have been any advancements in AJAX-ing ads since then (HTML5 doesn't provide any solutions I can think of...)
The TLDR version of that page is that:
Given google's annoying (and strict) terms, might I suggest using another ad network
尝试 Adsense 自定义搜索广告。它允许您使用关键字(可以是长句子)来展示广告。 [编辑:根据tos不允许,关键字必须由用户提交]
Try Adsense Custom Search Ads. It allows you to use keywords (could be long sentences) to show ads. [edit: it's not permitted according to tos, keywords must be user submitted]