问题描述
是否可以在本地服务器上运行Google Adsense广告作为示例应用程序的试用版?我想在我的网络应用程序中实施Google adsense广告,该应用程序要在本地网站上运行,然后才能在实时网站中实施.如果可能的话,请给我建议一下.
Is it possible to run google adsense ads on a local server as a try out for a example application?I want to implement Google adsense ads in my web application which is running on a localost befor implementing in a live website.If possible then please suggest me the way.
谢谢.
推荐答案
是有可能的(截至2015年).有一个特殊的参数,可以在Localhost上使用Adsense,而不会带来任何风险.
Yes it is possible (as of 2015). There is a special parameter, to use Adsense on Localhost without risks.
今天,AdSense代码有所不同.如果要添加adtest参数,请在ins块内使用data-adtest="on"
.这是示例代码:
Today the AdSense code is different. If you want to add the adtest-parameter use data-adtest="on"
within an ins block. Here is an example code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- XYZ 336 x 280 -->
<ins class="adsbygoogle"
style="display:inline-block;width:336px;height:280px"
data-ad-client="ca-pub-XXXXXXXXXXXXX"
data-adtest="on"
data-ad-slot="XXXXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
在Google AdManager帮助中找到了此内容
它显示了有关如何实现此目标的基本教程.
It shows a basic tutorial on how to achieve this.
测试Ad Exchange代码,而无需向广告客户收费或记录点击次数和展示次数
这篇关于Google adsense是否可用于localhost?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!