This TD export integration lets you create and upload audience data to NextRoll
- Basic Knowledge of Treasure Data™
- Have Adroll account
- 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.
- Don't support create duplicate audience name (case insensitive) in the same audience type
If you use authentication method PAT then you need
- NextRoll developer account to create an Application
- api_key from your account.
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


- Fill your App Name then click request and fill Callback URL (Ex: https://127.0.0.1)

- After create success. From My Apps choose it and copy API Key

Login into Adroll account https://app.adroll.com/
Choose setting from left sidebar

- From setting page choose Personal Access Token and click New then store the token

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
- Open TD Console
- Navigate to Integrations Hub > Catalog
- Search for and select NextRoll

Select Create Authentication, chose Authentication Method then provide your information
Select Continue, enter a name for the Authentication, and select Done.
The TD Console supports multiple ways to export data. Please follow the below steps to export data from the Data Workbench
- Navigate to Data Workbench > Queries
- Select New Query, and define your query
- Select Export Results to configure the data exporting

- Select an existing authentication, or create a new one following the above section
- Configure the exporting parameters as described in the Configuration Parameters below, and select Done
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 |
|---|---|
| Require for Audience Type CRM Need at least 100 valid emails to create audience | |
| id | Require for Audience Type Custom |
| 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:
|
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:
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": "" }
]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: 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: |
Country | string | Country to target the audience. Follow ISO 3166-1 alpha-2 Example: 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 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.
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.
Navigate to Data Workbench > Queries
Create a new query or select an existing query.
Next to Schedule, select None.

In the drop-down, select one of the following schedule options:

Drop-down Value Description Custom cron... Review 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.

| 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. |
- (Optional) You can delay the start time of a query by enabling the Delay execution.
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.
You can also send segment data to the target platform by creating an activation in the Audience Studio.
- Navigate to Audience Studio.
- Select a parent segment.
- Open the target segment, right-mouse click, and then select Create Activation.
- In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
- Customize the activation output in the Output Mapping panel.

- 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 Columnsto 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.
- + Add string to create strings for export. Select from the following values:
- Set a Schedule.

- Select the values to define your schedule and optionally include email notifications.
- Select Create.
If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.
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.
For CRM audience
_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: trueFor Cross-channel Lookalike audience
_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: 10For Custom audience
_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: trueFor Composite audience
_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: 10For Impression audience
_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: 120For User Attributes audience
_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" : ""
}
]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.
The format of the option is JSON, and the general structure is as follows.
For CRM Audience
{
"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
{
"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
{
"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
{
"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
{
"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
{
"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 | 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:
| 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
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 |
OAuth authentication
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- You can use Scheduled Job with Result Export to periodically upload data to a target destination