# NextRoll Export Integration このTDエクスポート連携により、オーディエンスデータをNextRollに作成してアップロードできます。 ## 前提条件 - Treasure Data™の基本知識 - Adrollアカウントを保有していること ## 制限事項 - デフォルトのクォータは、1日あたりサービスごとに100件のAPIリクエストです。制限の引き上げが必要な場合は、[NextRollサポートにメッセージを送信](https://apidocs.nextroll.com/support.md#support)してください。 - 同じオーディエンスタイプ内で重複するオーディエンス名(大文字小文字を区別しない)の作成はサポートされていません ## 要件 認証方法としてPATを使用する場合、以下が必要です - アプリケーションを作成するためのNextRoll開発者アカウント - アカウントのapi_key ## API キーと Personal Access Token の取得 - NextRoll Developer アカウントを作成するか、既にアカウントをお持ちの場合はログインしてください https://developers.nextroll.com/accounts/login - アカウントから Apps を選択し、New App をクリックします ![](/assets/nextroll-export-integration-2025-08-07-1.8e5b1c84834628775a1c3b282ad1b726d31904cdc4383e18aeea3be3087447fc.90a1c57a.png) ![](/assets/nextroll-export-integration-2025-08-07.dac785b8caa68f636b907dbb4696aa76af995016e31cac8fa5721aebc920b2fb.90a1c57a.png) - App Name を入力し、request をクリックして Callback URL を入力します(例: https://127.0.0.1) ![](/assets/nextroll-export-integration-2025-08-07-2.df02be692d9901e0d52db7264e31f8412cf121008d5e17821b9d6789a00c9e5e.90a1c57a.png) - 作成に成功したら、My Apps から選択して API Key をコピーします ![](/assets/nextroll-export-integration-2025-08-07-3.2c632ccf790a6432e50e2a9b077a469cacd603ee25c1e6b330ba30f9944ce589.90a1c57a.png) - Adroll アカウントにログインします [https://app.adroll.com/](https://app.adroll.com/) - 左サイドバーから設定を選択します ![](/assets/nextroll-export-integration-2025-08-07-4.7958ee993976a901cbf4ff319dc6a09a3337965fecc178858f96ee5696193b54.90a1c57a.png) - 設定ページから Personal Access Token を選択し、New をクリックしてトークンを保存します ![](/assets/nextroll-export-integration-2025-08-07-5.ed350d6d08596ad94ecc4875f958a9702c51f8f26c4767b3b1daf82047f67d16.90a1c57a.png) ## 新しい接続の作成 TD Consoleで、クエリを実行する前にデータ接続を作成して設定する必要があります。データ接続の一部として、以下の手順に従って連携にアクセスするための認証を提供します。 1. **TD Console**を開きます 2. **Integrations Hub > Catalog**に移動します 3. **NextRoll**を検索して選択します ![](/assets/screenshot-2025-08-07-at-19.12.43.b7953187d9dcca01e0cd0bc1dad2ba24911fc96d98286505ceaed82ad0e6c5c6.90a1c57a.png) 1. **Create Authentication**を選択し、認証方法を選択して情報を入力します 2. **Continue**を選択し、認証の名前を入力して**Done**を選択します。 ## エクスポート用のクエリ結果の設定 TD Consoleは複数のデータエクスポート方法をサポートしています。以下の手順に従って、Data Workbenchからデータをエクスポートしてください。 1. **Data Workbench > Queries**に移動します 2. **New Query**を選択し、クエリを定義します 3. **Export Results**を選択してデータエクスポートを設定します ![](/assets/screenshot-2024-05-27-at-13.08.60.c660e2874c5efd5898076c87205c9c1c3579e1232c32206db66443388b0163ee.9c1a955f.png) 1. 既存の認証を選択するか、上記のセクションに従って新しい認証を作成します 2. 以下の[設定パラメータ](/int/google-customer-match-export-integration#configuration-parameters)に記載されているようにエクスポートパラメータを設定し、**Done**を選択します ### クエリの定義 クエリには、CRMまたはCustomオーディエンスタイプに必要な列を含める必要があります。他の列は無視されます。必須列はnullまたは空の値を受け入れません(そうでない場合、レコードは無効とみなされスキップされます)。他のオーディエンスタイプはオーディエンスを作成するためにデータを必要としません。そのため、クエリ "SELECT 1;" または "SELECT ... FROM .. limit 1;" を使用してください。それ以外の場合はエラーが返されます。 **データ要件:** - MD5ハッシュ化: email。ハッシュ化されていない場合は、コネクタによって自動的にハッシュ化されます | **カラム名** | **説明** | | --- | --- | | email | Audience Type CRMに必須 - オーディエンスを作成するには少なくとも100件の有効なメールアドレスが必要です | | id | Audience Type Customに必須 | ### 設定パラメータ | Parameter | Data type | Description | | --- | --- | --- | | **Audience Type** 必須 | string | 以下を含む: Composite, CRM, Crosschannel Lookalike, Custom, Impression, User Attributes | | **Advertiser ID** 必須 | string | NextrollアカウントのAds ID | | **Audience Name** 必須 | string | オーディエンスの名前 | | **List type** 必須 | string | 2種類のデータがサポートされています: - **User Data**: メール、電話、または住所を使用してユーザープロファイルをアップロード - **Mobile Data**: モバイルアプリケーションのデータ(IDFAまたはAAID)をアップロード | | **Impression(s)** | integer | このオーディエンスに追加されるためにユーザーが受信する必要がある最小インプレッション数。有効な値は0より大きい値です。 Audience Type Impressionに必須 | | **Duration** | integer | メンバーがこのセグメントで有効である日数。有効な値は1〜120日です。デフォルト値: 120 | | **Attributes** | String | JSON配列形式の文字列。各項目には3つのプロパティが必要です: `name`, `values`, `comparator` - **name**: 属性名 - **values**: 文字列値の配列 - **comparator**: 文字列(サポートされる値: `in`, `not_in`) **注**: valuesが空の配列の場合、comparatorは空の文字列である必要があります。 例: ```json [ { "name": "attribute_name1", "values": ["v1", "v2"], "comparator": "in" }, { "name": "attribute_name2", "values": ["v3", "v4"], "comparator": "not_in" }, { "name": "attribute_name3", "values": [], "comparator": "" } ] ``` Audience Type User Attributesに必須 | | **Components** | string | Segment EIDで指定された2つ以上のオーディエンスのリスト(カンマ区切り)。すべてのコンポーネントは有効な既存のオーディエンスである必要があり、別の複合オーディエンスであってはなりません。複合オーディエンスに複数の属性オーディエンスを含めることはできません。 例: `Segment_EID_1, Segment_EID_2, ...` Audience Type Compositeに必須 | | **This is a conversion audience** | boolean | オーディエンスがコンバージョンオーディエンスであるかどうかを示します。デフォルト: `false` | | **Conversion Value** | float | 各コンバージョンの価値。浮動小数点値を受け入れます。 例: `0.3` | | **Country** | string | オーディエンスをターゲットにする国。[ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)に従います 例: `US` Audience Type Crosschannel Lookalike に必須 | | **Is Include Country** | boolean | 国設定からのメンバーのみを含めるかどうかを確認します。デフォルト: `true` | | **Source Segment EID** | string | オーディエンスを作成するためのソースセグメントEID。ソースセグメントはCRM、閲覧ページ、または任意のデータのタイプである必要があります。ソースセグメントサイズは、少なくとも合計100人の訪問者と、Facebook訪問者については1100人である必要があります。 Audience Type Crosschannel Lookalikeに必須 | | **Size** | integer | 1〜10のスケールでの広さと狭さの選択。デフォルトは `10` Audience Type Crosschannel Lookalikeに必須 | | **Allow International Seeds** | boolean | 国際シードを許可するかどうかを示します。デフォルト: `false` | | **Skip on invalid records?** | boolean | デフォルト: `true` | 同じ設定名(大文字小文字を区別しない)、オーディエンスタイプを持つオーディエンスが存在し、Audience TypeがCRMまたはCustomではない場合、エラーが返されます。Audience TypeがCRMまたはCustomの場合、このオーディエンスが既に存在する場合はユーザーデータを追加します。 ### (オプション) Query Export ジョブをスケジュールする Scheduled Jobs と Result Export を使用して、指定したターゲット宛先に出力結果を定期的に書き込むことができます。 Treasure Data のスケジューラー機能は、高可用性を実現するために定期的なクエリ実行をサポートしています。 2 つの仕様が競合するスケジュール仕様を提供する場合、より頻繁に実行するよう要求する仕様が優先され、もう一方のスケジュール仕様は無視されます。 例えば、cron スケジュールが `'0 0 1 * 1'` の場合、「月の日」の仕様と「週の曜日」が矛盾します。前者の仕様は毎月 1 日の午前 0 時 (00:00) に実行することを要求し、後者の仕様は毎週月曜日の午前 0 時 (00:00) に実行することを要求するためです。後者の仕様が優先されます。 #### TD Console を使用してジョブをスケジュールする 1. **Data Workbench > Queries** に移動します 2. 新しいクエリを作成するか、既存のクエリを選択します。 3. **Schedule** の横にある None を選択します。 ![](/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png) 4. ドロップダウンで、次のスケジュールオプションのいずれかを選択します: ![](/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png) | ドロップダウン値 | 説明 | | --- | --- | | Custom cron... | [Custom cron... の詳細](#custom-cron-details)を参照してください。 | | @daily (midnight) | 指定されたタイムゾーンで 1 日 1 回午前 0 時 (00:00 am) に実行します。 | | @hourly (:00) | 毎時 00 分に実行します。 | | None | スケジュールなし。 | #### Custom cron... の詳細 ![](/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png) | **Cron 値** | **説明** | | --- | --- | | `0 * * * *` | 1 時間に 1 回実行します。 | | `0 0 * * *` | 1 日 1 回午前 0 時に実行します。 | | `0 0 1 * *` | 毎月 1 日の午前 0 時に 1 回実行します。 | | "" | スケジュールされた実行時刻のないジョブを作成します。 | ``` * * * * * - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +---------- month (1 - 12) | | +--------------- day of month (1 - 31) | +-------------------- hour (0 - 23) +------------------------- min (0 - 59) ``` 次の名前付きエントリを使用できます: - Day of Week: sun, mon, tue, wed, thu, fri, sat. - Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec. 各フィールド間には単一のスペースが必要です。各フィールドの値は、次のもので構成できます: | フィールド値 | 例 | 例の説明 | | --- | --- | --- | | 各フィールドに対して上記で表示された制限内の単一の値。 | | | | フィールドに基づく制限がないことを示すワイルドカード `'*'`。 | `'0 0 1 * *'` | 毎月 1 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。 | | 範囲 `'2-5'` フィールドの許可される値の範囲を示します。 | `'0 0 1-10 * *'` | 毎月 1 日から 10 日までの午前 0 時 (00:00) に実行するようにスケジュールを設定します。 | | カンマ区切りの値のリスト `'2,3,4,5'` フィールドの許可される値のリストを示します。 | `0 0 1,11,21 * *'` | 毎月 1 日、11 日、21 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。 | | 周期性インジケータ `'*/5'` フィールドの有効な値の範囲に基づいて、 スケジュールが実行を許可される頻度を表現します。 | `'30 */2 1 * *'` | 毎月 1 日、00:30 から 2 時間ごとに実行するようにスケジュールを設定します。 `'0 0 */5 * *'` は、毎月 5 日から 5 日ごとに午前 0 時 (00:00) に実行するようにスケジュールを設定します。 | | `'*'` ワイルドカードを除く上記の いずれかのカンマ区切りリストもサポートされています `'2,*/5,8-10'` | `'0 0 5,*/10,25 * *'` | 毎月 5 日、10 日、20 日、25 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。 | 1. (オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。 ### クエリを実行する クエリに名前を付けて保存して実行するか、単にクエリを実行します。クエリが正常に完了すると、クエリ結果は指定された宛先に自動的にエクスポートされます。 設定エラーにより継続的に失敗するスケジュールジョブは、複数回通知された後、システム側で無効化される場合があります。 (オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。 ## Audience Studio で Segment をアクティベートする Audience Studio で activation を作成することで、segment データをターゲットプラットフォームに送信することもできます。 1. **Audience Studio** に移動します。 2. parent segment を選択します。 3. ターゲット segment を開き、右クリックして、**Create Activation** を選択します。 4. **Details** パネルで、Activation 名を入力し、前述の Configuration Parameters のセクションに従って activation を設定します。 5. **Output Mapping** パネルで activation 出力をカスタマイズします。 ![](/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png) - Attribute Columns - **Export All Columns** を選択すると、変更を加えずにすべての列をエクスポートできます。 - **+ Add Columns** を選択して、エクスポート用の特定の列を追加します。Output Column Name には、Source 列名と同じ名前があらかじめ入力されます。Output Column Name を更新できます。**+ Add Columns** を選択し続けて、activation 出力用の新しい列を追加します。 - String Builder - **+ Add string** を選択して、エクスポート用の文字列を作成します。次の値から選択します: - String: 任意の値を選択します。テキストを使用してカスタム値を作成します。 - Timestamp: エクスポートの日時。 - Segment Id: segment ID 番号。 - Segment Name: segment 名。 - Audience Id: parent segment 番号。 1. **Schedule** を設定します。 ![](/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png) - スケジュールを定義する値を選択し、オプションでメール通知を含めます。 1. **Create** を選択します。 batch journey の activation を作成する必要がある場合は、[Creating a Batch Journey Activation](/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey-activation) を参照してください。 ## (オプション) Workflowを使用したエクスポート連携 Treasure Workflow内で、データコネクタを使用してデータをエクスポートすることができます。 詳細については、[TD Toolbeltを使用したワークフローによるデータのエクスポート](https://api-docs.treasuredata.com/en/tools/cli/api/#workflow-commands)を参照してください。 CRMオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: crm advertiser_id: xxx audience_name: xxxx skip_crm_invalid_records: true ``` Cross-channel Lookalikeオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: crosschannel_lal advertiser_id: xxx audience_name: xxxx country: US include_country: true source_segment_eid: 'xxxxx' size: 5 allow_international_seeds: false crosschannel_lal_duration: 10 ``` Customオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: custom advertiser_id: xxx audience_name: xxxx custom_duration: 120 skip_custom_invalid_records: true ``` Compositeオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: composite advertiser_id: xxx audience_name: xxxx components: "xxx,xxx,xxx......" is_composite_conversion: true composite_conversion_value: '0.1' composite_duration: 10 ``` Impressionオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: impression advertiser_id: xxx audience_name: xxxx impression_value: 4 impression_duration: 120 ``` User Attributesオーディエンスの場合 ```yaml _export: td: database: nextroll +nextroll_export_task: td>: export.sql database: ${td.database} result_connection: new_created_nextroll result_settings: type: nextroll audience_type: user_attributes advertiser_id: xxx audience_name: xxxx attributes: | [ { "name" : "attr_1", "values" : ["test_value_1", "test_value_2"], "comparator" : "in" }, { "name" : "attr_2", "values" : ["test_value_3", "test_value_4"], "comparator" : "not_in" }, { "name" : "attr_3", "values" : [], "comparator" : "" } ] ``` ## (オプション) CLIを使用したエクスポート連携 CLI(Toolbelt)を使用してNextRollに結果をエクスポートすることもできます。 `td query`コマンドの`--result`オプションを使用して、アカウントへのエクスポート情報を指定する必要があります。`td query`コマンドの詳細については、[この記事](https://docs.treasuredata.com/display/PD/TD+Toolbelt+Job+and+Query+Command+Reference)を参照してください。 オプションの形式はJSONで、一般的な構造は以下のとおりです。 CRM Audienceの場合 ```json { "type": "nextroll", "td_authentication_id":"xxxx", "audience_type": "crm", "advertiser_id": "xxx", "audience_name": "xxxx", "skip_crm_invalid_records": true } ``` Cross-channel Lookalikeオーディエンスの場合 ```json { "type": "nextroll", "td_authentication_id": "xxx", "audience_type": "crosschannel_lal", "advertiser_id": "xxx", "audience_name": "xxxx", "country": "xx", "include_country": true, "source_segment_eid": "xxxxx", "size": 5, "allow_international_seeds": false, "crosschannel_lal_duration": 10 } ``` ``` Customオーディエンスの場合 ```json { "type": "nextroll", "td_authentication_id": "xxx", "audience_type": "custom", "advertiser_id": "xxx", "audience_name": "xxxx", "custom_duration": 120, "skip_custom_invalid_records": true } ``` Compositeオーディエンスの場合 ```json { "type": "nextroll", "td_authentication_id": "xxxx", "audience_type": "composite", "advertiser_id": "xxx", "audience_name": "xxxx", "components": "xxx,xxx,xxx......", "is_composite_conversion": true, "composite_conversion_value": "0.1", "composite_duration": 10 } ``` Impressionオーディエンスの場合 ```json { "type": "nextroll", "td_authentication_id": "xxxx", "audience_type": "impression", "advertiser_id": "xxx", "audience_name": "xxxx", "impression_value": 4, "impression_duration": 120 } ``` User Attributesオーディエンスの場合 ```json { "type": "nextroll", "td_authentication_id": "xxx", "audience_type": "user_attributes", "advertiser_id": "xxx", "audience_name": "xxxx", "attributes": [ { "name": "attr_1", "values": ["test_value_1", "test_value_2"], "comparator": "in" }, { "name": "attr_2", "values": ["test_value_3", "test_value_4"], "comparator": "not_in" }, { "name": "attr_3", "values": [], "comparator": "" } ] } ``` ### パラメータ | Name | Description | Value | Default Value | Required | | --- | --- | --- | --- | --- | | type | コネクタタイプ | nextroll | N/A | Yes | | oauth_credentials_id | コンソールで作成された認証情報ID | N/A | N/A | Yes | | audience_type | Audience Type | サポート対象:- composite - crm - crosschannel_lal - custom - impression - user_attributes | crm | Yes | | advertiser_id | Advertiser ID | N/A | N/A | Yes | | advertiser_name | Advertiser Name | N/A | N/A | Yes | | impression_value | このオーディエンスに追加されるためにユーザーが受信する必要がある最小インプレッション数。有効な値は0より大きい値です。 | N/A | N/A | audience_typeがimpressionの場合は必須 | | impression_duration | メンバーがこのセグメントで有効である日数。有効な値は1〜120日です。 | [1-120] | 120 | No | | attributes | JSON配列形式のオーディエンス属性の文字列。各項目には3つのプロパティが必要です: name, values, comparator - **name**: 属性名 - **values**: 文字列値の配列 - **comparator**: 文字列(サポートされる値: in, not_in) **注**: valuesが空の配列の場合、comparatorは空の文字列である必要があります。 例: ``` [ { "name": "attribute_name1", "values": ["v1", "v2"], "comparator": "in" }, { "name": "attribute_name2", "values": ["v3", "v4"], "comparator": "not_in" }, { "name": "attribute_name3", "values": [], "comparator": "" } ] ``` | N/A | N/A | audience_typeがuser_attributesの場合は必須 | | components | Segment EIDで指定された2つ以上のオーディエンスのリスト(カンマ区切り)。すべてのコンポーネントは有効な既存のオーディエンスである必要があり、別の複合オーディエンスであってはなりません。複合オーディエンスに複数の属性オーディエンスを含めることはできません。 例: Segment_EID_1, Segment_EID_2,...... | N/A | N/A | audience_typeがcompositeの場合は必須 | | is_composite_conversion | 複合オーディエンスがコンバージョンかどうか | true/false | false | No | | composite_conversion_value | 各コンバージョンの価値。浮動小数点値を受け入れます。 | N/A | N/A | No | | composite_duration | メンバーがこのセグメントで有効である日数。有効な値は1〜120日です。 | [1-120] | 120 | No | | country | オーディエンスをターゲットにする国。https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 に従います 例: US | N/A | N/A | audience_typeがcrosschannel_lalの場合は必須 | | include_country | 国設定からのメンバーのみを含めるかどうかを確認します | true/false | true | No | | source_segment_eid | オーディエンスを作成するためのソースセグメントEID。ソースセグメントはCRM、閲覧ページ、または任意のデータのタイプである必要があります。ソースセグメントサイズは、少なくとも合計100人の訪問者と、Facebook訪問者については1100人である必要があります。 | N/A | N/A | audience_typeがcrosschannel_lalの場合は必須 | | size | 1〜10のスケールでの広さと狭さの選択 | [1-10] | 10 | No | | allow_international_seeds | 国際シードを許可するかどうかを示します | true/false | false | No | | crosschannel_lal_duration | メンバーがこのセグメントで有効である日数。有効な値は1〜120日です。 | [1-120] | 120 | No | | custom_duration | メンバーがこのセグメントで有効である日数。有効な値は1〜120日です。 | [1-120] | 120 | No | | skip_custom_invalid_records | 無効なレコードを処理する際にジョブを続行するか停止するかのフラグ。 | true/false | true | No | | skip_crm_invalid_records | 無効なレコードを処理する際にジョブを続行するか停止するかのフラグ。 | true/false | true | No | ### 使用例 OAuth認証 ```bash td query --result \ '{"type":"nextroll","td_authentication_id":"xxx","audience_type":"crm","advertiser_id":"xxx","audience_name":"xxx","skip_crm_invalid_records":true}' \ -d sample_datasets "select ........ from ........" -T presto ``` ## その他 - [スケジュールジョブ](https://docs.treasuredata.com/articles/pd/scheduling-jobs-using-td-console)をResult Exportと組み合わせて使用することで、ターゲット宛先に定期的にデータをアップロードできます