セキュア シグナル アダプタを統合する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
セキュア シグナルは、クライアント デバイスで収集され、選択したビッダーと共有されるエンコードされたデータです。このガイドでは、IMA SDK を使用して安全なシグナルを収集し、Google アド マネージャーに送信する方法について説明します。
セキュア シグナル API には、tvOS 向け IMA SDK のバージョン 4.8.2 以降が必要です。
シグナルとビッダーを選択してセキュア シグナルの共有を有効にするには、ビッダーとセキュア シグナルを共有するをご覧ください。
サードパーティのシグナル プロバイダを使用する
安全なシグナルを使用するには、アプリにシグナル コレクタ アダプタ クラスをデプロイして、シグナルを収集、エンコードし、IMA SDK に渡す必要があります。
サードパーティ プロバイダの手順に沿って、プロバイダのアカウントを設定し、フレームワークを含め、アプリでセキュア シグナル アダプタを設定します。
tvOS 向け IMA SDK は、コードを変更しなくても、各セキュア シグナル アダプタを自動的に初期化します。
セキュア シグナル アダプタをプロジェクトに追加する方法の例を次に示します。

カスタムデータを送信する
サードパーティのシグナル プロバイダを使用するだけでなく、カスタムデータを使用してシグナルを収集、エンコード、送信することもできます。カスタムデータを含むセキュア シグナルを送信するには、アド マネージャーでカスタム シグナルを有効にする必要があります。
広告リクエストごとに、エンコードされたカスタムデータを文字列として含む IMASecureSignals
オブジェクトを作成します。次に、IMAAdsRequest.secureSignals
属性を呼び出して、広告リクエストに IMASecureSignals
オブジェクトを追加します。
Objective-C と Swift のサンプルを次に示します。
Objective-C
BasicExample/ViewController.m
...
- (void)requestAds {
// Create an ad display container for ad rendering.
IMAAdDisplayContainer *adDisplayContainer =
[[IMAAdDisplayContainer alloc] initWithAdContainer:self.videoView
viewController:self
companionSlots:nil];
// Create an ad request with our ad tag, display container, and optional user context.
IMAAdsRequest *request = [[IMAAdsRequest alloc] initWithAdTagUrl:kTestAppAdTagUrl
adDisplayContainer:adDisplayContainer
contentPlayhead:self.contentPlayhead
userContext:nil];
IMASecureSignals *signals =
[[IMASecureSignals alloc] initWithCustomData:@"My encoded signal string"];
request.secureSignals = signals;
[self.adsLoader requestAdsWithRequest:request];
}
...
Swift
BasicExample/ViewController.swift
...
private func requestAds() {
// Create ad display container for ad rendering.
let adDisplayContainer = IMAAdDisplayContainer(
adContainer: videoView, viewController: self, companionSlots: nil)
// Create an ad request with our ad tag, display container, and optional user context.
let request = IMAAdsRequest(
adTagUrl: ViewController.testAppAdTagURL,
adDisplayContainer: adDisplayContainer,
contentPlayhead: contentPlayhead,
userContext: nil)
let signals = IMASecureSignals(customData: "My encoded signal string")
request.secureSignals = signals
adsLoader.requestAds(with: request)
}
...
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eSecure signals, encoded data from client devices, are shared with specific bidders to enhance ad targeting.\u003c/p\u003e\n"],["\u003cp\u003eYou need to integrate a signal collector adapter and the IMA SDK (version 4.8.2 or higher for tvOS) to collect and send secure signals to Google Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eUtilize a third-party signal provider or, if eligible for a limited beta, send custom data as secure signals after enabling it in Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided code examples (Objective-C and Swift) for implementation guidance on adding secure signals to your ad requests.\u003c/p\u003e\n"]]],[],null,["Secure signals are encoded data that is collected on the client device and\nshared with select bidders. This guide shows you how to collect and send secure\nsignals to Google Ad Manager using the IMA SDK.\n\nThe secure signals API requires version 4.8.2\nor higher of the IMA SDK for tvOS.\n\nTo select signals and bidders, and enable secure signal sharing, see [Share\nsecure signals with bidders](//support.google.com/admanager/answer/10488752).\n\nUse a third-party signal provider\n\nTo use secure signals, you must deploy a signal collector\n\nadapter class in your app\n\nto collect signals, encode them, and pass them to the IMA SDK.\n\n\u003cbr /\u003e\n\nFollow your third-party provider's instructions to set up an account with them,\n\n[include frameworks](//developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/IncludingFrameworks.html),\n\nand set up their secure signals adapter in your app.\n\nThe IMA SDK for tvOS automatically\ninitializes each secure signals adapter, without any additional changes to your\ncode.\n\nHere's an example of how you might add a secure signals adapter to your project:\n\n\u003cbr /\u003e\n\nSend custom data\n\nIn addition to using a third-party signal provider, you can also collect,\nencode, and send signals with custom data. Before you can send secure signals\nwith custom data, you must turn on custom signals in Ad Manager.\n\n\u003cbr /\u003e\n\nFor each ad request, create an `IMASecureSignals` object containing your\nencoded custom data as a string. Then, add the `IMASecureSignals` object to\nyour ad request by calling the `IMAAdsRequest.secureSignals` attribute.\n\nHere are samples in Objective-C and Swift: \n\nObjective-C\n\n**BasicExample/ViewController.m** \n\n ...\n - (void)requestAds {\n // Create an ad display container for ad rendering.\n IMAAdDisplayContainer *adDisplayContainer =\n [[IMAAdDisplayContainer alloc] initWithAdContainer:self.videoView\n viewController:self\n companionSlots:nil];\n // Create an ad request with our ad tag, display container, and optional user context.\n IMAAdsRequest *request = [[IMAAdsRequest alloc] initWithAdTagUrl:kTestAppAdTagUrl\n adDisplayContainer:adDisplayContainer\n contentPlayhead:self.contentPlayhead\n userContext:nil];\n IMASecureSignals \\*signals =\n \\[\\[IMASecureSignals alloc\\] initWithCustomData:@\"My encoded signal string\"\\];\n request.secureSignals = signals;\n [self.adsLoader requestAdsWithRequest:request];\n }\n ...\n\nSwift\n\n**BasicExample/ViewController.swift** \n\n ...\n private func requestAds() {\n // Create ad display container for ad rendering.\n let adDisplayContainer = IMAAdDisplayContainer(\n adContainer: videoView, viewController: self, companionSlots: nil)\n // Create an ad request with our ad tag, display container, and optional user context.\n let request = IMAAdsRequest(\n adTagUrl: ViewController.testAppAdTagURL,\n adDisplayContainer: adDisplayContainer,\n contentPlayhead: contentPlayhead,\n userContext: nil)\n let signals = IMASecureSignals(customData: \"My encoded signal string\")\n request.secureSignals = signals\n adsLoader.requestAds(with: request)\n }\n ..."]]