# Nextroll Export Integration This TD export integration lets you create and upload audience data to NextRoll ## Prerequisites - Basic Knowledge of Treasure Data™ - Have Adroll account ## Limitations - The default quota is 100 API requests per service per day. If you think you need your limit increased, [send a message to NextRoll support](https://apidocs.nextroll.com/support.md#support). - Don't support create duplicate audience name (case insensitive) in the same audience type ## Requirements If you use authentication method PAT then you need - NextRoll developer account to create an Application - api_key from your account.​ ## Obtain the API key and Personal Access Token - Create NextRoll Developer account or login if you had one https://developers.nextroll.com/accounts/login - From your account chose Apps then click New App ![](/assets/nextroll-export-integration-2025-08-07-1.8e5b1c84834628775a1c3b282ad1b726d31904cdc4383e18aeea3be3087447fc.90a1c57a.png) ![](/assets/nextroll-export-integration-2025-08-07.dac785b8caa68f636b907dbb4696aa76af995016e31cac8fa5721aebc920b2fb.90a1c57a.png) - Fill your App Name then click request and fill Callback URL (Ex: https://127.0.0.1) ![](/assets/nextroll-export-integration-2025-08-07-2.df02be692d9901e0d52db7264e31f8412cf121008d5e17821b9d6789a00c9e5e.90a1c57a.png) - After create success. From My Apps choose it and copy API Key ![](/assets/nextroll-export-integration-2025-08-07-3.2c632ccf790a6432e50e2a9b077a469cacd603ee25c1e6b330ba30f9944ce589.90a1c57a.png) - Login into Adroll account [https://app.adroll.com/](https://app.adroll.com/) - Choose setting from left sidebar ![](/assets/nextroll-export-integration-2025-08-07-4.7958ee993976a901cbf4ff319dc6a09a3337965fecc178858f96ee5696193b54.90a1c57a.png) - From setting page choose Personal Access Token and click New then store the token ![](/assets/nextroll-export-integration-2025-08-07-5.ed350d6d08596ad94ecc4875f958a9702c51f8f26c4767b3b1daf82047f67d16.90a1c57a.png) ## Create a new Connection On TD Console, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access the integration following the below steps 1. Open **TD Console** 2. Navigate to **Integrations Hub > Catalog** 3. Search for and select **NextRoll** ![](/assets/screenshot-2025-08-07-at-19.12.43.b7953187d9dcca01e0cd0bc1dad2ba24911fc96d98286505ceaed82ad0e6c5c6.90a1c57a.png) 1. Select **Create Authentication**, chose Authentication Method then provide your information 2. Select **Continue**, enter a name for the Authentication, and select **Done**. ## Configure a Query Result for Export The TD Console supports multiple ways to export data. Please follow the below steps to export data from the Data Workbench 1. Navigate to **Data Workbench > Queries** 2. Select **New Query**, and define your query 3. Select **Export Results** to configure the data exporting ![](/assets/screenshot-2024-05-27-at-13.08.60.c660e2874c5efd5898076c87205c9c1c3579e1232c32206db66443388b0163ee.9c1a955f.png) 1. Select an existing authentication, or create a new one following the above section 2. Configure the exporting parameters as described in the [Configuration Parameters](/int/google-customer-match-export-integration#configuration-parameters) below, and select **Done** ### Define your Query Your query should include the required columns for the CRM or Custom audience type, other columns will be ignored. Required columns don't accept a null or empty value (else the record is considered invalid and skipped). Other audience type don't require data to create audience. So please use query "SELECT 1;" or "SELECT ... FROM .. limit 1;". Otherwise the error will be returned. **Data requirement:** - MD5 hashing: email. If not, they are hashed automatically by the connector | **Column name** | **Description** | | --- | --- | | email | Require for Audience Type CRM Need at least 100 valid emails to create audience | | id | Require for Audience Type Custom | ### Configuration Parameters | Parameter | Data type | Description | | --- | --- | --- | | **Audience Type** REQUIRED | string | Includes: Composite, CRM, Crosschannel Lookalike, Custom, Impression, User Attributes | | **Advertiser ID** REQUIRED | string | The Ads ID of Nextroll account | | **Audience Name** REQUIRED | string | Name of the audience | | **List type** REQUIRED | string | Two types of data are supported: - **User Data**: upload user profile using email, phone, or address - **Mobile Data**: upload data of a mobile application (IDFA or AAID) | | **Impression(s)** | integer | The minimum number of impressions users must receive to be added to this audience. Valid values are greater than 0. REQUIRED for Audience Type Impression | | **Duration** | integer | Number of days that members are valid in this segment. Valid values are between 1 and 120 days. Default value: 120 | | **Attributes** | String | String of JSON Array format. Every item must have 3 properties: `name`, `values`, `comparator` - **name**: attribute name - **values**: array of value in string - **comparator**: string (support values: `in`, `not_in`) **Note**: when values is empty array then comparator must be empty string. Example: ```json [ { "name": "attribute_name1", "values": ["v1", "v2"], "comparator": "in" }, { "name": "attribute_name2", "values": ["v3", "v4"], "comparator": "not_in" }, { "name": "attribute_name3", "values": [], "comparator": "" } ] ``` REQUIRED for Audience Type User Attributes | | **Components** | string | List of two or more audiences specified by their Segment EID separated by commas. All components must be valid existing audiences and must not be another composite audience. You cannot have multiple Attribute Audiences in a Composite Audience. Example: `Segment_EID_1, Segment_EID_2, ...` REQUIRED for Audience Type Composite | | **This is a conversion audience** | boolean | Indicate if audience is a conversion audience. Default: `false` | | **Conversion Value** | float | Amount each conversion is worth to you. Accept floating point value. Example: `0.3` | | **Country** | string | Country to target the audience. Follow [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: `US` REQUIRED for Audience Type Crosschannel Lookalike | | **Is Include Country** | boolean | Check if only include member from Country config. Default: `true` | | **Source Segment EID** | string | Source segment EID to create the audience. The source segment must be of type CRM, pages viewed or arbitrary data. The source segment size must be of at least 100 total visitors AND 1100 for facebook visitors. REQUIRED for Audience Type Crosschannel Lookalike | | **Size** | integer | A choice between broadness and narrowness on a 1-10 scale. Default is `10` REQUIRED for Audience Type Crosschannel Lookalike | | **Allow International Seeds** | boolean | Indicating if allow or not international seeds. Default: `false` | | **Skip on invalid records?** | boolean | Default: `true` | If there are any audiences with the same config name (Case Insensitive) , audience type and Audience Type is not CRM or Custom then an error will be return. With  Audience Type is CRM or Custom we will append user data into this audience if it has already existed. ### (Optional) Schedule Query Export Jobs You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify. Treasure Data's scheduler feature supports periodic query execution to achieve high availability. When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored. For example, if the cron schedule is `'0 0 1 * 1'`, then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed. #### Scheduling your Job Using TD Console 1. Navigate to **Data Workbench > Queries** 2. Create a new query or select an existing query. 3. Next to **Schedule**, select None. ![](/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png) 4. In the drop-down, select one of the following schedule options: ![](/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png) | Drop-down Value | Description | | --- | --- | | Custom cron... | Review [Custom cron... details](#custom-cron-details). | | @daily (midnight) | Run once a day at midnight (00:00 am) in the specified time zone. | | @hourly (:00) | Run every hour at 00 minutes. | | None | No schedule. | #### Custom cron... Details ![](/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png) | **Cron Value** | **Description** | | --- | --- | | `0 * * * *` | Run once an hour. | | `0 0 * * *` | Run once a day at midnight. | | `0 0 1 * *` | Run once a month at midnight on the morning of the first day of the month. | | "" | Create a job that has no scheduled run time. | ``` * * * * * - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +---------- month (1 - 12) | | +--------------- day of month (1 - 31) | +-------------------- hour (0 - 23) +------------------------- min (0 - 59) ``` The following named entries can be used: - Day of Week: sun, mon, tue, wed, thu, fri, sat. - Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec. A single space is required between each field. The values for each field can be composed of: | Field Value | Example | Example Description | | --- | --- | --- | | A single value, within the limits displayed above for each field. | | | | A wildcard `'*'` to indicate no restriction based on the field. | `'0 0 1 * *'` | Configures the schedule to run at midnight (00:00) on the first day of each month. | | A range `'2-5'`, indicating the range of accepted values for the field. | `'0 0 1-10 * *'` | Configures the schedule to run at midnight (00:00) on the first 10 days of each month. | | A list of comma-separated values `'2,3,4,5'`, indicating the list of accepted values for the field. | `0 0 1,11,21 * *'` | Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month. | | A periodicity indicator `'*/5'` to express how often based on the field's valid range of values a schedule is allowed to run. | `'30 */2 1 * *'` | Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. `'0 0 */5 * *'` configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month. | | A comma-separated list of any of the above except the `'*'` wildcard is also supported `'2,*/5,8-10'`. | `'0 0 5,*/10,25 * *'` | Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month. | 1. (Optional) You can delay the start time of a query by enabling the Delay execution. ### Execute the Query Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination. Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications. (Optional) You can delay the start time of a query by enabling the Delay execution. ## Activate a Segment in Audience Studio You can also send segment data to the target platform by creating an activation in the Audience Studio. 1. Navigate to **Audience Studio**. 2. Select a parent segment. 3. Open the target segment, right-mouse click, and then select **Create Activation.** 4. In the **Details** panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters. 5. Customize the activation output in the **Output Mapping** panel. ![](/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png) - Attribute Columns - Select **Export All Columns** to export all columns without making any changes. - Select **+ Add Columns** to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select **+ Add Columns**to add new columns for your activation output. - String Builder - **+ Add string** to create strings for export. Select from the following values: - String: Choose any value; use text to create a custom value. - Timestamp: The date and time of the export. - Segment Id: The segment ID number. - Segment Name: The segment name. - Audience Id: The parent segment number. 1. Set a **Schedule**. ![](/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png) - Select the values to define your schedule and optionally include email notifications. 1. Select **Create**. If you need to create an activation for a batch journey, review [Creating a Batch Journey Activation](/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey-activation). ## (Optional) Export Integration Using the workflow Within Treasure Workflow, you can specify the use of a data connector to export data. Learn more at [Using Workflows to Export Data with the TD Toolbelt](https://api-docs.treasuredata.com/en/tools/cli/api/#workflow-commands). For CRM audience ```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 ``` For Cross-channel Lookalike audience ```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 ``` For Custom audience ```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 ``` For Composite audience ```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 ``` For Impression audience ```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 ``` For User Attributes audience ```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" : "" } ] ``` ## (Optional) Export Integration Using the CLI You can also use CLI (Toolbelt) to export results to NextRoll. You need to specify the information for export to your Account using the `--result` option of the `td query` command. For more information about the `td query` command, refer to [this article](https://docs.treasuredata.com/display/PD/TD+Toolbelt+Job+and+Query+Command+Reference). The format of the option is JSON, and the general structure is as follows. For CRM Audience ```json { "type": "nextroll", "td_authentication_id":"xxxx", "audience_type": "crm", "advertiser_id": "xxx", "audience_name": "xxxx", "skip_crm_invalid_records": true } ``` For Cross-channel Lookalike audience ```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 } ``` For Custom audience ```json { "type": "nextroll", "td_authentication_id": "xxx", "audience_type": "custom", "advertiser_id": "xxx", "audience_name": "xxxx", "custom_duration": 120, "skip_custom_invalid_records": true } ``` For Composite audience ```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 } ``` For Impression audience ```json { "type": "nextroll", "td_authentication_id": "xxxx", "audience_type": "impression", "advertiser_id": "xxx", "audience_name": "xxxx", "impression_value": 4, "impression_duration": 120 } ``` For User Attributes audience ```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": "" } ] } ``` ### Parameters | Name | Description | Value | Default Value | Required | | --- | --- | --- | --- | --- | | type | connector type | nextroll | N/A | Yes | | oauth_credentials_id | Credential id that was created on the console | N/A | N/A | Yes | | audience_type | Audience Type | Supported:- 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 | The minimum number of impressions users must receive to be added to this audience. Valid values are greater than 0. | N/A | N/A | Yes if audience_type is impression | | impression_duration | Number of days that members are valid in this segment. Valid values are between 1 and 120 days. | [1-120] | 120 | No | | attributes | Attributes of audience String of JSON Array format. Every item must have 3 properties: name, values, comparator - **name**: attribute name - **values**: array of value in string - **comparator**: string (support values: in, not_in) **Note**: when values is empty array then comparator must be empty string. Example: ``` [ { "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 | Yes if audience_type is user_attributes | | components | List of two or more audiences specified by their Segment EID separated by commas. All components must be valid existing audiences and must not be another composite audience. You cannot have multiple Attribute Audiences in a Composite Audience. Ex: Segment_EID_1, Segment_EID_2,...... | N/A | N/A | Yes if audience_type is composite | | is_composite_conversion | Whether composite audience is conversion | true/false | false | No | | composite_conversion_value | Amount each conversion is worth to you. Accept floating point value. | N/A | N/A | No | | composite_duration | Number of days that members are valid in this segment. Valid values are between 1 and 120 days. | [1-120] | 120 | No | | country | Country to target the audience. Follow https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Example: US | N/A | N/A | Yes if audience_type is crosschannel_lal | | include_country | Check if only include member from Country config | true/false | true | No | | source_segment_eid | Source segment EID to create the audience. The source segment must be of type CRM, pages viewed or arbitrary data. The source segment size must be of at least 100 total visitors AND 1100 for facebook visitors. | N/A | N/A | Yes if audience_type is crosschannel_lal | | size | A choice between broadness and narrowness on a 1-10 scale | [1-10] | 10 | No | | allow_international_seeds | Indicating if allow or not international seeds | true/false | false | No | | crosschannel_lal_duration | Number of days that members are valid in this segment. Valid values are between 1 and 120 days. | [1-120] | 120 | No | | custom_duration | Number of days that members are valid in this segment. Valid values are between 1 and 120 days. | [1-120] | 120 | No | | skip_custom_invalid_records | The flag to continue or stop the job when handling the invalid record. | true/false | true | No | | skip_crm_invalid_records | The flag to continue or stop the job when handling the invalid record. | true/false | true | No | ### Example for Usage OAuth authentication ```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 ``` ## Others - You can use [Scheduled Job](https://docs.treasuredata.com/articles/pd/scheduling-jobs-using-td-console)  with Result Export to periodically upload data to a target destination