使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
收起空广告位
默认情况下,未填充的广告位会保持可见状态,这可能会导致您的网页出现空白。如果您事先知道网页上的一个或多个广告位不太可能填充广告,则可以指示 Google 发布商代码 (GPT) 库收起这些广告位。
此功能的最佳配置将取决于您预期的广告位填充频率:
- 如果大多数情况下槽会被填充,请使用
PubAdsService.collapseEmptyDivs()
。在此配置中,广告位在默认情况下处于展开状态,仅当无法填充时才会收起。
- 如果大多数情况下槽都不会填充,请使用
PubAdsService.collapseEmptyDivs(true)
。在此配置中,广告位默认处于收起状态,只有在可以填充时才会展开。
由于在 GPT 开始运行之前 googletag
API 调用无效,因此为了最大限度地减少重排量,您还需要在网页上配置 CSS,使默认收起的广告位的尺寸为零。
如果网页上的特定广告位更有可能被填充,您还可以配置按广告位替换项(如下例所示)。
实现示例
观看演示
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]