This plugin is recommended for large data sets.

Alternatively, you can use Salesforce Marketing Cloud (ExactTarget) Data Connector for small data sets, to write job results.

Treasure Data can publish user segments into Salesforce Marketing Cloud (ExactTarget), and enable you to send personalized emails to your customers. You can run data-driven email campaigns, by using your first-party data from Web, Mobile, CRM, and other data sources.

This data connector is in Beta. For more information, contact



Open SSH 7.8 Private Key is supported. The format of the key is detected and the correct library to use is chosen.

Set Up a Secure, Automated Account in Salesforce

Access your Salesforce account to begin set up.

Create an FTP Account

On the SFMC dashboard, in your account, select Administration.

From the Account drop-down menu, select FTP Accounts. This allows you to establish an SFTP account.

In the FTP Accounts panel, select Add FTP User.

Provide an FTP account password.

Review your SFTP account information.

Configure for Automatic Mail Delivery

Go back to the SFMC dashboard, and select Email Studio > Email.

Select Content > Create > Template > From Existing Template to create an email template.

After creating the template, select Save > Save and Exit and then provide a template name and location, and save that information as well.

Remaining on the Email page, select Create > Email to create email content (for example, for a campaign) from a template.

Select the template, define the email properties, including name and location, and select Next to provide content. Continue creating the email and save it when you are finished.

Define Specification for Import into Salesforce

Create an Import Interaction in Salesforce

From the Email view, select Interactions.

Select Import.

Select Create to make a new import interaction definition.

Provide the import interaction information, including SFTP information and data import location. Save the information.

Specify the Import Trigger

From the Email view, select the SFDC blue cloud icon to view menu options.

Select Journey Builder > Automation Studio.

Select New Automation.

Drag the File Drop icon to Starting Source.

Select Configure> Trigger Automation.

Specify Use Filename Pattern and then select Done.

Drag the Send Email icon to the canvas and select Create New.

Select an email object, for example, the one you created in this section. Select Next. Select an email target list. Select Next. Verify the email configuration information, and select Finish.

Provide a name for the import trigger and an external key that is referred to by Treasure Data, and select Save.

Select Active to enable the import trigger.

Select Save and Close.

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection prior to running your query. As part of the data connection, you provide authentication to access the integration.

Enter the required credentials for your remote SFTP instance. Name the connection. If you would like to share this connection with other users in your organization, check the Share with others checkbox. If this box is unchecked this connection is visible only to you.  

Open TD Console.
Navigate to Integrations Hub Catalog.
Search for and select Salesforce Marketing Cloud via SFTP.

Select Create Credentials.
Type the credentials to authenticate.

Type or select values for the parameters:
Host The host information of the remote SFTP instance, for example, an IP address.
PortThe connection port on the remote FTP instance, the default is 22.
UserThe user name used to connect to the remote FTP instance.
Authentication mode

The way you choose to authenticate with your SFTP server.

  • public/private key pair
  • password

Open SSH 7.8 Private Key is supported. The format of the key is detected and the correct library to use is chosen.

Secret key fileRequired if 'public / private key pair' is selected from `Authentication Mode`. (The key type ed25519 is not supported but the ecdsa key type is supported.)
Passphrase for secret key file(Optional) If required, provide a passphrase for the provided secret file.
Retry limitNumber of times to retry a failed connection (default 10).

Connection timeout in seconds

Use proxy?

If selected, enter the details for the proxy server. 

  • Type
  • Host
  • Port
  • User
  • Password
  • Command
Sequence format

Format for sequence part of output files (string, default: ".%03d.%02d")

Select Continue.
Type a name for your connection.
Select Done.

Define your Query

Create a job that selects data from within Treasure Data. The specified column name for the mapping must match the column name in the SFMC Exact Target mail. “Email Address” and “Subscriber Key” columns are required. If needed, you can change the mapped column name that is in TD database. You can change the column name from within the TD Console.

Integration Parameters

You could specify more parameters for the target export file:

Example Query

Optionally Schedule the Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Optionally Configure Export Results in Workflow

Within Treasure Workflow, you can specify the use of this data connector to export data. 

Learn more at Using Workflows to Export Data with the TD Toolbelt.

Example Workflow 

timezone: UTC

    database: sample_datasets

  td>: queries/sample.sql
  result_connection: your_connections_name
    secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    advertiser_id: xxxxxx
    data_activation_duration: 43200

Verifying the Query Export Job

After the job finishes, you can check the output file on the SFTP server by using the general SFTP command, as shown in the following example:

Check the SFMC dashboard to verify a successful import. If the import and mail delivery is successful, you can see Complete on the Automation Studio Overview page.