|
|
Documentation Wiki > ExactTarget > Interactions > Activities > Data Extract Activity > Extract Types > Tracking Extract > Using Tracking Extracts
Using Tracking ExtractsFrom $1Table of contents
This document contains conceptual and procedural information about creating and using tracking extracts. What are Tracking ExtractsYou can use tracking extracts to export granular data regarding several different aspects of email send jobs (such as clicks, bounces, and survey data) from the ExactTarget application and import that information into another program or system. Why Use Tracking ExtractsTracking extracts retrieve data before sends are executed, meaning that the data includes information on any subscriber that would be listed as undeliverable or excluded by List Detective. Tracking extracts can also be scheduled via a program. Tracking extracts also include column heading information. How to Create a Tracking Extract Via the ApplicationFollow the instructions on creating a data extract activity and select Tracking Extract from the Extract Type dropdown menu. Complete the following fields depending on the data you want to be included in your tracking extract:
Click Save to finish your tracking extract. Once you've finished, start your activity to get the results. How to Create Automated Tracking Extracts with ProgramsFollow these steps to automate the creation of a tracking extract using Programs.
Depending on how you've set up your program, your tracking extract updates its information periodically. How to Create a Tracking Extract via the SOAP APIUsing the SOAP API like the example listed below, you can create your tracking extract via an API call. Please refer to the Extract method for more information on executing this API call. public DataTable ByMonth(DateTime startDate, DateTime endDate, string notificationEmail)
{
int cntr = 0;
DataTable resultTable = new DataTable();
resultTable.Columns.Add(new DataColumn("FileName"));
resultTable.Columns.Add(new DataColumn("Details"));
DataRow dr = null;
ExtractRequest request = new ExtractRequest();
ExtractRequest[] requests = new ExtractRequest[1];
List<ExtractParameter> extractParameters = new List<ExtractParameter>();
ExtractParameter extractParam = null;
ExtractResult[] responses;
// first, we need to get the age as a TimeSpan
TimeSpan tsEnd = startDate - (new DateTime(1, 1, 1));
// then we can subtract that TimeSpan from the current date to return a DateTime object
// note that subtracting a DateTime from a DateTime returns a TimeSpan object, which is
// the reason for the first step above (we need a DateTime to get the years without
// having to go through some ugly calculation)
DateTime difference = endDate.Subtract(tsEnd);
// we'll need to subtract a year to account for that fact that we were forced to use the
// year 1 above in the new DateTime statement (throws an exception if you use 0)
int numMonths = difference.Month + (difference.AddYears(-1).Year * 12);
for (int i = 0; i < numMonths; i++)
{
request = new ExtractRequest();
requests = new ExtractRequest[1];
extractParameters = new List<ExtractParameter>();
request.ID = "c7219016-a7f0-4c72-8657-1ec12c28a0db"; // This is a constant value used to identify the desired extract. This is required.
extractParam = new ExtractParameter();
extractParam.Name = "StartDate";
extractParam.Value = new DateTime(startDate.AddMonths(i).Year, startDate.AddMonths(i).Month, startDate.AddMonths(i).Day).ToString(); // In this example, we will grab 5 days worth of data ending now.
extractParameters.Add(extractParam);
DateTime endDateTime = new DateTime(startDate.AddMonths(i + 1).Year, startDate.AddMonths(i + 1).Month, startDate.AddMonths(i + 1).Day);
if (endDateTime > DateTime.Now)
{
endDateTime = new DateTime(startDate.AddMonths(i).Year, startDate.AddMonths(i).Month, DateTime.Now.AddDays(-1).Day);
}
extractParam = new ExtractParameter();
extractParam.Name = "EndDate";
extractParam.Value = endDateTime.ToString();
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractOpens";
extractParam.Value = "true"; // Get opens, set to false to not return opens
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractClicks";
extractParam.Value = "true"; // Get clicks, set to false to not return clicks\
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractSent";
extractParam.Value = "true"; // Get sent events, set to false to not return sent envents
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractUnsubs";
extractParam.Value = "true"; // Get unsubscribes, set to false to not return unsubscribes.
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractConversions";
extractParam.Value = "false"; // Get conversion events, set to false to not return conversions.
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractSurveyResponses";
extractParam.Value = "false"; // Get survey respones, set to false to not return survey respones.
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractBounces";
extractParam.Value = "true"; // Get bounces, set to false to not reutrn bounces.
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractSubscribers";
extractParam.Value = "true"; // Get subscribers, set to false to not return subscribers.
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "ExtractSends";
extractParam.Value = "true"; // Get sends, set to false to not return sends
extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "QuoteText";
extractParam.Value = "true"; // Quote the text
extractParameters.Add(extractParam);
//Specify FileTransferLocation only if an external FTP site is used, other EFTP used automatically.
//extractParam = new ExtractParameter();
//extractParam.Name = "FileTransferLocation";
//extractParam.Value = "ExactTarget FTP Export";
//extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "OutputFileName";
extractParam.Value = String.Format("tracking_{0}-{1}-{2}_to_{3}-{4}-{5}.zip", startDate.AddMonths(i).Year.ToString(), startDate.AddMonths(i).Month.ToString(), startDate.AddMonths(i).Day.ToString(), startDate.AddMonths(i + 1).Year.ToString(), startDate.AddMonths(i + 1).Month.ToString(), startDate.AddMonths(i + 1).Day.ToString()); // the name of the output file you want generated.
extractParameters.Add(extractParam);
// extractParam = new ExtractParameter();
// extractParam.Name = "SendIDs";
// extractParam.Value = "13332311,13269052,13277798,13278152,13209321"; // Used to filter results to only theses sends
// extractParameters.Add(extractParam);
//extractParam = new ExtractParameter();
//extractParam.Name = "SendIDs";
//extractParam.Value = send.ID.ToString();
//extractParameters.Add(extractParam);
extractParam = new ExtractParameter();
extractParam.Name = "NotificationEmail";
extractParam.Value = notificationEmail;
extractParameters.Add(extractParam);
request.Parameters = extractParameters.ToArray();
requests[0] = request;
overallResult = integrationFramework.Extract(requests, out requestID, out responses);
// Log results
dr = resultTable.NewRow();
dr["FileName"] = String.Format("tracking_{0}-{1}-{2}_to_{3}-{4}-{5}.zip", startDate.AddMonths(i).Year.ToString(), startDate.AddMonths(i).Month.ToString(), startDate.AddMonths(i).Day.ToString(), startDate.AddMonths(i + 1).Year.ToString(), startDate.AddMonths(i + 1).Month.ToString(), startDate.AddMonths(i + 1).Day.ToString());
dr["Details"] = String.Format("{0} - [{1}] {2}", overallResult, responses[0].ErrorCode, responses[0].ErrorCode);
resultTable.Rows.Add(dr);
}
return resultTable;
}
How Much Data is Contained in a Tracking Extract?The application returns tracking extract data in a ZIP file, and the size of that file can vary depending on the amount of activity, the accounts involved, and the types of data requested. How Do I Import Tracking Extract Data Into My Program?No primary key is defined in the event tables of the tracking extract. Any relationships between primary key tables and event tables should be enforced by code and not foreign keys. Primary key tables include the following tables:
Event tables include the following tables:
Event tables may include duplicate rows due to differences in time by seconds or larger This page was last updated by Josh Cloud on Fri, 20 May 2011 15:17:52 GMT. If you're having an application issue, please contact Global Support. To send Josh direct feedback, fill out the form below:
Tags: (Edit tags)
|
Powered by MindTouch 2010 |