Google パブリッシャー タグのサンプル
このセクションでは、Google パブリッシャー タグ(GPT)ライブラリの例と関連リソースを紹介します。
このセクションの内容の多くは、GitHub リポジトリでも入手できます。サンプルコードと関連ドキュメントは、Apache License 2.0 のオープンソースとしてリリースされています。
GPT サンプル ビルダー(ベータ版)を使用して、独自のカスタム サンプルを作成してみましょう。
制限付きの広告を表示する
Cookie またはその他のローカル ID の使用について同意が得られていない場合に広告を表示します。
Key-value targeting
Use key-value targeting to control the ads eligible to serve to specific ad slots.
Control SRA batching
Precisely control which ad slots are requested when in Single Request Architecture (SRA) mode.
Ad sizes
Specify which ad sizes are eligible to serve to an ad slot.
[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"]]