Google 发布商代码示例
本部分包含一系列有关 Google 发布商代码 (GPT) 库的示例和相关资源。
您还可以在我们的 GitHub 代码库中找到本部分中的大部分内容。示例代码和关联文档根据 Apache License 2.0 的开源代码发布。
不妨尝试使用 GPT 示例构建器(Beta 版)构建您自己的自定义示例!
展示受限广告
在用户未同意使用 Cookie 或其他本地标识符时展示广告。
Key-value targeting
Use key-value targeting to control the ads eligible to serve to specific ad slots.
Ad sizes
Specify which ad sizes are eligible to serve to an ad slot.
Control SRA batching
Precisely control which ad slots are requested when in Single Request Architecture (SRA) mode.
[null,null,[],[[["This section offers a variety of Google Publisher Tag (GPT) examples and resources, with much of the content mirrored in a dedicated GitHub repository."],["The code and documentation are open-source and available under the Apache License 2.0."],["Users can explore and create custom GPT samples using the GPT sample builder (beta)."]]],["The provided content details resources for the Google Publisher Tag (GPT) library, offering examples and sample code. This code, along with documentation, is available open-source under the Apache License 2.0 in a GitHub repository. Users can also build custom samples using the GPT sample builder (beta). Resources cover diverse topics, including JavaScript, TypeScript, events, multiple ads, performance, privacy, targeting, shadow DOM, and web components.\n"]]