- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的页面上有一个响应式广告单元,出于某种原因,它的高度为 60 像素,而我确实需要它为 90 像素,并在屏幕变小时切换到 300x250。有什么办法可以控制吗?
附注这是非常标准的 adsense 代码
<div classs="adunit">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Pmember Resp1 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-****"
data-ad-slot="*****"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
它的css是
.adunit {max-width:730px}
我试过了
<ins class="adsbygoogle"
style="display:block;min-height:90px"
我试过了
.adunit {min-height:90px}
最佳答案
您正在使用智能调整(data-ad-format
属性)并且您可以控制总体形状...
... by changing the value of data-ad-format to one of these values: "rectangle", "vertical", "horizontal" or any combination of these separated by a comma, e.g., "rectangle, horizontal".
创建自适应广告单元/指定一般形状
https://support.google.com/adsense/answer/3543893
如果您想完全控制高度,您需要删除 data-ad-format
并使用 @media
查询:
<style type="text/css">
.adslot_1 { width: 320px; height: 100px; }
@media (min-width:500px) { .adslot_1 { width: 300px; height: 250px; } }
@media (min-width:800px) { .adslot_1 { min-width: 300px; max-width: 970px; width:100%; height: 90px } }
</style>
<ins class="adsbygoogle adslot_1"
style="display:inline-block;"
data-ad-client="ca-pub-1234"
data-ad-slot="5678"></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
以上代码段是“指定可扩展宽度和固定高度”和“指定每个屏幕宽度的确切尺寸”的组合,来自 page I linked .
如果你想把这个单元放在页面的顶部,那么我想你会想要离开 .adslot_1 { width: 320px;高度:100px; }
按照我的建议编写代码,因为:
Is placing a 300x250 ad unit on top of a high-end mobile optimized page considered a policy violation?
Yes, this would be considered a policy violation as it falls under our ad placement policies for site layout that pushes content below the fold. This implementation would take up too much space on a mobile optimized site's first view screen with ads and provides a poor experience to users. Always try to think of the users experience on your site - this will help ensure that users continue to visit.
AdSense 政策常见问题解答/第 3 部分:移动相关
https://support.google.com/adsense/answer/3394713?hl=en#3
也许您会想看我写的关于使用 AdSense 查询 @media
的小教程:
为什么我们不应该在 AdSense ins 标记上使用@media 查询
https://productforums.google.com/forum/#!topic/adsense/TiihLH_gMnw
关于html - 响应式 adsense 单元的最小高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32619900/
我目前将我的 Adsense 广告余额设置为 40%-60%,这是提高收入的理想百分比? 如果你自己也是adsense的用户,那么你选择的比例是多少? 我试过用它进行调整,但似乎很长时间没有任何效果。
我使用这个脚本 if(typeof(window.google_render_ad)=="undefined") { //document.getElementById('player-embed'
我正在使用 mediawiki 的一个实例,并将 Adsense 添加到皮肤的 php 文件中。这会在所有页面上放置 Adsense 横幅,但我想从非常特定的页面中省略 Adsense 横幅。主要是“
我已经构建了一个 Web 应用程序。 登录后,会显示两个 Google Adsense 广告。 问题是,即使我的 web 应用程序是一个任务/项目管理工具,所宣传的产品几乎总是相同的,而且我猜有很多产
一位客户要求我使用他的 Google 发布商 ID 和广告 ID 创建他的广告。 他告诉我在博客上创建这个。 我现在的问题是我不知道他到底是什么意思,因为我习惯的是复制代码并粘贴它。 那么,有人可以向
这个问题在这里已经有了答案: Why Adsense ads don't show up in website home page (2 个回答) 8 年前关闭。 我有一个新闻网站。 Adsense
google adsense 如何判断被点击的广告是有效还是无效(被人恶意点击或被机器人点击)? 我知道一家公司在做这种工作。 http://www.adometry.com/ 以前称为 Click
你能告诉我,谷歌广告是如何工作的吗? 请简要解释我.. 最佳答案 有quite a bit of information可从 Google 获得有关该主题的信息。 关于adsense - Google
我想在我的网站上添加 Google AdSense,并且我想添加 X 语言(不是英语)。我如何告诉谷歌网站上使用的是哪种语言? 谢谢! 最佳答案 https://www.google.com/adse
我的网站刚刚通过 AdSense 批准,我尝试在网站上放置一些基本的展示广告。 我已经设置了广告,并在我的项目中粘贴了 HTML 代码。 当我访问该网站时,控制台显示: Failed to load
我有一个发布免费备份软件的网站。我网站 (codessentials.com) 上的 adsense 框总是显示 5 个与备份相关的广告之一。 在许多网站上,您可以看到 Adsense 框显示基于用户
我正在尝试将我的网站重新提交给 Google AdSense,但它一次又一次地出现以下错误: A user with the email you specified already exists Pl
我正在尝试创建我的 google 帐户 adsense,但此时我卡住了 我需要在第二行做标记吗? 我只需要等待? 代码在我的网站上:www.codando.com 谢谢 最佳答案 您需要点击蓝色的大按
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 11 年前关闭。 Improve this
我最近为我的项目创建了一个演示站点,每周大约有 150 次 +/- 访问。我想将 Google AdSense 添加到该网站,我不希望从中赚到任何大钱,但我真的很想获得一些使用 Google Adse
我希望当有人点击 Google AdSense 广告时,广告商的网站会在新窗口中打开。 最佳答案 其反对 adsense policy .据我所知,只有选定的发布商允许这样做,通常是流量巨大的大网站。
我想知道是否可以将自定义字段放在可用于过滤 API 调用的广告单元上,并用于计算该内容的收入,以便与网站的内容创建者分享收入。 内容创作者有 500 多个,自定义 channel 限制在 500 个,
关闭。这个问题需要debugging details .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve this questio
如何使 Google Adsense 块透明? 它使用 iframe,并驻留在其他域中,因此 jQuery 无能为力。我试图用 css 来定位它,但这也是不可能的。有任何想法吗? 我不是要玩游戏 Ad
如何在一个网站上拥有多个 AdSense 单元? Google 提供的唯一代码是按单位计算的。 (adsbygoogle = window.adsbygoogle || []).push({})
我是一名优秀的程序员,十分优秀!