Using Salesforce Marketing Cloud to Extract Data
By: Fabienne Ishimwe
Tags: Marketing Cloud, Data Extraction, Marketing Automation, Salesforce

Measuring the effectiveness of your marketing efforts is crucial to understanding your customer's needs and growing your business. And while Marketing Cloud has great reporting and analytics capabilities, your company might have a complex application architecture that uses external systems for marketing intelligence. In such a scenario, you may need to share your Marketing Cloud data through your FTP site.

Below is a step-by-step guide for extracting Marketing Cloud data to your FTP through the user interface in a format that can be imported into your external systems.

Option 1: Using the Default Tracking Extract

Marketing Cloud Tracking Extract contains a detailed level of information about email sends relating to various metrics such as clicks, opens, and bounces. This extract also retrieves data before a send executes, such as emails excluded through List Detective. For more information about the List Detective tool, visit this link: https://help.salesforce.com/articleView?id=mc_es_list_detective.htm&type=5

Step 1: Create a Data Extract activity in the Automation Studio.

Click the Create Activity button under the Activities tab in Automation Studio.

2. Select the Data Extract activity type.

3. Fill out the Data Extract activity properties:

The file naming pattern should have a .zip extension.

The extract type should be Tracking Extract.

4. Configure the Data Extract:

A maximum of 90 days can be selected for the Rolling Range option and only 30 days for the Specific Range option.

Account Ids: Specify the MID of the business unit for which you want to extract the tracking data. If left blank, the account running this extract will be used. Use an asterisk to extract all business units tracking data in an enterprise edition.

Email Send Definition External key: Use an email send external key if you would like to filter out tracking data for that send. Alternatively, specify the Send IDs.

Specify the format of the individual files in the extract zip file. It can be CSV, Tab, or XML.

Click all of the checkboxes that apply to the send tracking data you are looking for.

5. Confirm that the extract was configured properly, and click Finish.

Step 2: Create a File Transfer activity in the Automation Studio.

Click the Create Activity button under the Activities table in Automation Studio.

2. Select the File Transfer activity type.

3. Name the activity, select Move a File From Safehouse, and click Next.

4. Enter the File Naming Pattern specified in the Data Extract activity.

5. Confirm that the activity was configured properly, and click Finish.

Step 3: Create the automation

Click New Automation under the Overview tab in Automation Studio.

2. Drag Schedule, Data Extract, and File Transfer from the starting source onto the canvas. Ensure the File Transfer step occurs after the Data Extract step.

3. Configure the schedule of the automation. Click Choose on both the Data Extract and the File Transfer to select the activities created in Step 1 and 2. To run the automation immediately, click Run Once. Additionally, under the Activities tab, you can specify the email to which to send run completion or runtime error notifications.

Step 4: Access the extract through a secure third-party FTP and SFTP tool, such as WinSCP (optional).

WinSCP download page: https://winscp.net/eng/download.php

For demonstration purposes, I have used WinSCP to transfer the Extract to my computer. However, your external systems will probably be configured to pick up the file from your FTP server.

Retrieve your FTP information from setup: URL, Port, Username, and Password.

2. Open WinSCP on your computer, and enter the FTP information in 1 and click Login: Host name is your FTP site URL.

3. Find the Extract zip file in your Remote Site Import folder. Drag and drop the Extract zip file to your computer.

4. Open the zip file on your computer to access the individual files containing different metrics. The second screenshot below is of the Clicks file. As you can see, it contains granular information about click activity for specific sends.

Clicks

Option 2: Using SQL Query, Data Views, and Data Extensions

Marketing Cloud Data Views are systems tables that contain up to six months of detailed subscriber and journey information. They can only be accessed using queries and cannot be modified. Using an example, this section will demonstrate how to use SQL queries to retrieve tracking data from data views and insert the query result in a data extension. The data extension will then be exported to an FTP site through automation.

Step 1: Create the Data Extension in Email Studio

Create a data extension with fields that you would like to retrieve from your query. This will be the Target Data Extension for your query results.

Step 2: Create a SQL Query activity Automation Studio

More information about the SQL Query activity can be found here: https://help.salesforce.com/articleView?id=mc_as_using_the_query_activity.htm&type=5

Click the Create Activity button under the Activities tab in Automation Studio.

2. Select the SQL Query activity type.

3. Fill out the properties of the Query, and click Next.

4. Write the Query, and click Next.

Below is a query to find subscribers who have not opened or clicked within Marketing Cloud emails.

5. Select the Target Data Extension and the Data Action.

6. Confirm the summary, and click Finish.

Step 3: Create a Data activity in the Automation Studio.

Repeat the steps for creating a Data Extract with the following properties:

Extract Type: Data Extension Extract

DECustomer Key: the SQL Query target Data Extension External Key

File Naming Pattern: CSV file extension (example: NoOpensOrClicks.csv)

Step 4: Create a File Transfer activity in the Automation Studio.

Repeat the steps for creating a file transfer activity with the following properties:

File Naming Pattern: same as the one in the Data Extract Activity above

Step 5: Create the automation.

The automation should be set up with the SQL Query, Data Extract Activity, and File Transfer as in the screenshot below:

Step 6: Access the extract through a secure third-party FTP and SFTP tool such as WinSCP.

NoOpensOrClicks.csv

I hope you find this guide useful. Please feel free to reach out if you have any questions.

Cervello, a Kearney company is a data and analytics consulting firm and part of Kearney, a leading management consulting firm. We help our leading clients win by offering unique expertise in data and analytics, and in the challenges associated with connecting data. We focus on performance management, customer and supplier relationships, and data monetization and products, serving functions from sales to finance. We are a Salesforce partner and help our clients implement, customize, and optimize the platform into the best solution for their needs.