刷新包含 Google 广告的 Div [英] Refresh a Div that has a Google ad inside it

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

问题描述

我有一个 <div> 包含一个谷歌广告.我的网站主要是 AJAX,不需要刷新浏览器.这意味着我的广告也不会刷新,这并不理想,用户整天盯着一个广告.

所以我想要一种方法来刷新页面上的特定

.我找到了很多解决方案,但都没有奏效.比如使用JQuery的html函数:

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

这设法刷新了整个页面,不知道如何.我还可以向包含 Google 广告的 HTML 页面发出 AJAX 请求,但我猜它会产生与上述尝试相同的效果.

我不想使用 iFrame.

还有其他选择吗?我的豌豆脑已经想不起来了.:)

这是允许的,因为我只会在用户点击链接时启动刷新.

一个典型的例子是雅虎邮箱——他们的新 AJAX 邮箱使用了同样的方法,当用户点击一个链接时,就会显示一个新广告.

解决方案

正如其他两个答案所述,不允许自动刷新您的 AdSense 广告.我知道您只是打算根据用户操作刷新广告,但仍然不允许,即使它应该是!

请记住,您要更新广告的原因是为了显示新广告.显示广告被称为印象".当您使用代码刷新广告时,您会自动生成广告展示次数.

AdSense计划政策状态(强调我的):

<块引用>

无效点击和展示

对 Google 广告的点击必须来自真正的用户兴趣.严禁任何人为地在您的 Google 广告上产生点击或展示的方法.这些被禁止的方法包括但不限于重复手动点击或展示、使用机器人、自动点击和展示生成工具、第三方产生点击或展示的派对服务,例如付费点击、付费浏览、自动冲浪和点击交换程序,或任何欺骗性软件.

刷新您的广告违反了禁止产生印象的规则.话虽如此,我认为任何有理智的人都会同意在 AJAX 应用程序中刷新广告响应用户行为(例如响应点击)并不违反精神 规则.

例如,想象一下重写整个应用程序以停止使用 AJAX.这对您的用户来说显然是一种糟糕的体验(速度较慢,每次点击页面都会闪烁,页面无法在后台动态更新),但从技术上讲,这并不违反 AdSense 计划政策.

显然,谷歌意在禁止每五秒自动替换广告(创建广告的幻灯片").Google 还打算禁止让您的网站看起来比您实际拥有的访问量更多,从而使您的网站对广告商更具吸引力.我敢肯定,他们不会打算阻止您设计高性能的 AJAX 网站……但不幸的是,有时规则会产生意想不到的后果.

当然,正如您最初指出的那样,如果您将广告嵌入 iframe 并修改其位置,您仍然可以刷新广告.(这里是如何在 AJAX 应用程序中使用 iframe 刷新 AdSense.)

您在最初的问题中拒绝了 iframe,可能是因为您知道使用 iframe 会违反 Google 的政策……但如果您坚持违反规则,那么您还不如一路违反!;-)

最终,我认为您会发现以这种方式产生印象并不值得冒险:您将刷新"广告只是发现 Google 只是向您展示了与以前完全相同的广告.

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.

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");

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.

I do not want to use iFrames.

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

EDIT:

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

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.

解决方案

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!

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 Program Policies state (emphasis mine):

Invalid Clicks and Impressions

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.

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.

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.

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.

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! ;-)

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.

这篇关于刷新包含 Google 广告的 Div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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