刷新一个DIV,有一个谷歌的广告里面 [英] Refresh a Div that has a Google ad inside it

查看:134
本文介绍了刷新一个DIV,有一个谷歌的广告里面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个< D​​IV> 持有一个谷歌的广告。我的网站是大多AJAX和没有必要为一个浏览器的刷新。这意味着我的广告不会刷新要么,这是不理想的,用户盯着整天一个广告。

I have a <div> that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isn't ideal, a user staring at one ad all day.

于是我就想办法刷新一个特定的&LT; D​​IV&GT; 在页面上。我发现了很多解决方案,但他们没有工作。例如,使用jQuery的HTML功能:

So I wanted a way to refresh a particular <div> on a page. I found many solutions but they didn't work. For example, using JQuery's html function:

$("#ads").html("google ad script here");

这成功地刷新整个页面不知道如何。我还可以使一个AJAX请求到包含谷歌广告的HTML页面,但我猜测它会产生相同的效果上面的尝试。

This managed to refresh the whole page no idea how. I can also make an AJAX request to a HTML page that contains the Google ad but I am guessing it will have the same effect as the above attempt.

我不想使用iframe。

I do not want to use iFrames.

是否有任何其他选项,打开给我吗?我的豌豆大脑无法再想下去了。 :)

Is there any other option open to me? My pea brain can not think of anymore. :)

这是允许的,因为我将开始刷新,只有当用户点击一个链接。

It is allowed since I will be initiating the refresh only when a user clicks a link.

一个典型的例子是雅虎邮件 - 他们的新AJAX的邮箱使用同样的方法,当用户点击一个链接,然后一个新的广告展示

A prime example is Yahoo Mail - their new AJAX mailbox uses this same method, when a user clicks a link then a new ad is shown.

推荐答案

由于双方的其他答案的状态,自动刷新您的AdSense广告,是不允许的。据我所知,你只打算刷新广告,以响应用户的动作,但它的还是的是不允许的,即使它应该是!

As both of the other answers state, refreshing your AdSense advertisements automatically isn't allowed. I understand that you only intend to refresh the ad in response to user action, but it still isn't allowed, even though it should be!

记住,你之所以要更新的广告是为了让您可以显示新的。显示广告被称为即时pression。当您使用code刷新广告,您将自动生成广告IM pressions。

Remember, the reason why you want to update the advertisements is so that you can show new ones. Displaying an advertisement is called an "impression." When you use code to refresh the ads, you are automatically generating ad impressions.

的AdSense计划政策国家(重点煤矿):

AdSense Program Policies state (emphasis mine):

无效点击和Im pressions

Invalid Clicks and Impressions

在谷歌广告的点击必须来自真正感兴趣的用户。 人为产生的点击或IM pressions您的谷歌广告的方法是严格禁止的。这些被禁止的手段包括但不限于重复的手动点击或IM pressions,采用机器人,自动化点击和IM pression生成工具,可产生点击或IM pressions如付费点击,付费冲浪,自动冲浪和点击交换程序,或任何欺诈性软件的第三方服务。

Clicks on Google ads must result from genuine user interest. Any method that artificially generates clicks or impressions on your Google ads is strictly prohibited. These prohibited methods include but are not limited to repeated manual clicks or impressions, using robots, automated click and impression generating tools, third-party services that generate clicks or impressions such as paid-to-click, paid-to-surf, autosurf, and click-exchange programs, or any deceptive software.

刷新你的广告是违反对产生IM pressions规则的信。随着中说,我认为,任何理智的人都会同意以响应用户行为在AJAX应用程序的的令人耳目一新的广告的(例如,在响应点击)是不是违反了精神。

Refreshing your advertisements is a violation of the letter of the rule against generating impressions. With that said, I think any reasonable person would agree that refreshing advertisements in an AJAX app in response to user behavior (e.g. in response to a click) isn't a violation of the spirit of the rule.

例如,假设重写整个应用程序,以停止使用AJAX。这显然​​为您的用户(它的速度较慢,在每一次点击的页面闪烁,该页面无法动态地在后台更新),但是,通过技术性,这不是违反了AdSense计划政策的糟糕​​经历。

For example, imagine rewriting your entire app to stop using AJAX. That's clearly a worse experience for your users (it's slower, the page flashes on every click, the page can't dynamically update in the background), but, by a technicality, it's not a violation of the AdSense Program Policies.

显然,谷歌的意味着的禁止自动更换广告,每五秒钟(创建的广告的幻灯片)。谷歌也意味着禁止使您的网站看起来更加吸引广告主通过出现有更多的访问比你实际拥有。我敢肯定,他们没有的打算的从设计高性能的AJAX网站...但不幸的是有时候规则产生意想不到的后果prevent你。

Clearly Google meant to prohibit automatically replacing the advertisements every five seconds (creating a "slideshow" of advertisements). Google also meant to prohibit making your site look more attractive to advertisers by appearing to have more visits than you actually have. I'm sure they didn't intend to prevent you from designing a high-performance AJAX website... but unfortunately sometimes rules have unintended consequences.

当然,作为您最初指出的那样,你仍然可以刷新你的广告,如果你把它们嵌入在iframe中,并修改它的位置。 (下面介绍如何使用iframe在AJAX应用程序刷新的AdSense 。)

Of course, as you originally pointed out, you CAN still refresh your advertisements if you embed them in an iframe and modify its location. (Here's how to use iframes in an AJAX application to refresh AdSense.)

您拒绝了你最初的问题内部框架,也许是因为你知道,使用内置页框将违反谷歌的政策......但如果​​你坚持打破规则,你还不如打破他们一路走好! ; - )

You rejected iframes in your initial question, perhaps because you knew that using iframes would violate Google's policies... but if you insist on breaking the rules, you might as well break them all the way! ;-)

最后,我想你会发现,产生IM pressions这种方式是不值得冒险:你会刷新的广告才发现,谷歌只是显示你完全一样的广告,前

Ultimately, I think you'll find that generating impressions this way isn't worth the risk: you'll "refresh" the ads only to find that Google is just showing you the exact same ads as before.

这篇关于刷新一个DIV,有一个谷歌的广告里面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆