Skip to content
Last updated

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.
  • 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

  • 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

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

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

  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

  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 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 nameDescription
emailRequire for Audience Type CRM Need at least 100 valid emails to create audience
idRequire for Audience Type Custom

Configuration Parameters

Parameter Data typeDescription

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

DurationintegerNumber 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:

[
  { "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 audiencebooleanIndicate 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

Example: US

REQUIRED for Audience Type Crosschannel Lookalike

Is Include CountrybooleanCheck 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 SeedsbooleanIndicating if allow or not international seeds. Default: false
Skip on invalid records?booleanDefault: 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.

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

    Drop-down ValueDescription
    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.
    NoneNo schedule.

Custom cron... Details

Cron ValueDescription
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 ValueExampleExample 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.

  • 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.
  1. Set a Schedule.

  • 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.

(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.

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: true

For 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: 10

For 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: true

For 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: 10

For 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: 120

For 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" :  ""
      }
    ]

(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.

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": ""
    }
  ]
}

Parameters

Name Description Value Default Value Required
typeconnector typenextrollN/AYes
oauth_credentials_idCredential id that was created on the consoleN/AN/AYes
audience_typeAudience TypeSupported:
  • composite
  • crm
  • crosschannel_lal
  • custom
  • impression
  • user_attributes
crmYes
advertiser_idAdvertiser IDN/AN/AYes
advertiser_nameAdvertiser NameN/AN/AYes
impression_valueThe minimum number of impressions users must receive to be added to this audience. Valid values are greater than 0.N/AN/AYes if audience_type is impression
impression_durationNumber of days that members are valid in this segment. Valid values are between 1 and 120 days.[1-120]120No

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_conversionWhether composite audience is conversiontrue/falsefalseNo
composite_conversion_valueAmount each conversion is worth to you. Accept floating point value.N/AN/ANo
composite_durationNumber of days that members are valid in this segment. Valid values are between 1 and 120 days.[1-120]120No

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_countryCheck if only include member from Country configtrue/falsetrueNo
source_segment_eidSource 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/AN/AYes if audience_type is crosschannel_lal
sizeA choice between broadness and narrowness on a 1-10 scale[1-10]10No
allow_international_seedsIndicating if allow or not international seedstrue/falsefalseNo
crosschannel_lal_durationNumber of days that members are valid in this segment. Valid values are between 1 and 120 days.[1-120]120No
custom_durationNumber of days that members are valid in this segment. Valid values are between 1 and 120 days.[1-120]120No
skip_custom_invalid_recordsThe flag to continue or stop the job when handling the invalid record.true/falsetrueNo
skip_crm_invalid_recordsThe flag to continue or stop the job when handling the invalid record.true/falsetrueNo

Example for Usage

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

Others

  • You can use Scheduled Job  with Result Export to periodically upload data to a target destination