Step 7: Verify the Data Import and Classification

The import job can take several hours to complete once it has been submitted. Once the import job finishes processing, you can check if the data was properly classified in the Adobe Marketing Cloud by running a report on Brands or Categories.

In Analytics UI, navigate to Products > Products > Brand.

Notice that the report data that comes back shows the brand classification data that you added.

Export classification records

After you create, populate and import your classifications for the first time, you might find that you need to update them. In this section, you will learn how to export, update and re-import classification records in three steps:

  1. Create an export job using the Saint.ExportCreateJob() method.
  2. Check the job status using the Saint.CheckJobStatus() method.
  3. Retrieve the report data using the Saint.ExportGetFileSegment() method.

After you retrieve the data, you can update it and then import using the information outlined earlier in this article for creating and populating an import job.

Creating an export job

Create the export job using the Saint.ExportCreateJob() method and the parameters in the following table.




The list of report suites from which to export data.


The filter option based on campaign activity or date. Supported values include:

  • 0 : All Campaigns (No filter) (default)
  • 1 : Active campaigns
  • 2 : Campaign by begin and end date


The campaign start date to filter the data.


The campaign end date to filter the data.


The start date for including rows in the export.


The end date for including rows in the export.


The email address to receive SAINT export job notifications.


The unique ID for the basic report element data you are exporting. This ID is returned from the Saint.GetCompatibilityMetrics() method.

The following code shows you how to export filtered classification records.

PHP Code

/* SAINT Export Create Job */ 
$exportParams = array( 
'date_filter_row_start_date'=>'Jan 2000', 
'date_filter_row_end_date'=>'Jan 2050', 
'relation_id'=>, // relation id 

$response = sendRequest('Saint.ExportCreateJob', $exportParams ); 
if (is_string($response)) { 
$job_id = (int)$response; 
if (!is_int($job_id)) 
$job_id = FALSE; 
} else { 
$job_id = FALSE; 

Java Code

/* Call Saint.ExportCreateJob -Submits parameters to create an export file in SAINT. This file represents classifications for a given relation */ 
String responseExportCreateJob = port.saintExportCreateJob("", "", 0, "Jan 2000", "Jan 2050", "", "", , report_suite_array, "", "", "", 0, 1000); 
System.out.println("responseExportCreateJob retuned a : "+responseExportCreateJob);

Checking the Job Status

After creating an export job, you can check on its status using Saint.CheckJobStatus() method.

This method returns a two-part status response that is an array where you must look for both a status of completed and Ready.

When this condition occurs store the file_id and the viewable_pages from the second response part.

/* SAINT Check Report Status */ 
$response = ''; 
$done = FALSE; 
$viewable_pages = 0; 
$file_id = 0; 
$check_count = 0; 
while (!$done && $check_count < $max_checks) { 
if ($debug) echo("st_exportCheckAndRetrieve(): checking job_id = $job_id\n"); 
/* Saint.CheckJobStatus */ 
$response = sendRequest('Saint.CheckJobStatus', array('job_id'=>$job_id ) ); 
if (is_array($response)) { 
if (stristr($response[0]['status'], 'completed') !== FALSE 
&& count($response) > 1 
&& is_array($response[1]) 
&& $response[1]['status'] == 'Ready' 
) { 
if ($response[1]['type'] == 'file_id' && $response[1]['status'] == 'Ready') { 
$viewable_pages = $response[1]['viewable_pages']; 
$file_id = $response[1]['id']; 
$done = TRUE; 
if ($debug) echo("st_exportCheckAndRetrieve(): looping again... $check_count\n"); 
}//end: while 

if ($check_count >= $max_checks && ! $done) throw new Exception('st_exportCheckAndRetrieve(): timed out while pinging CheckJobStatus'); 
if ($file_id <= 0) throw new Exception('st_exportCheckAndRetrieve(): no file_id was retrieved from CheckJobStatus'); 
if ($viewable_pages <= 0) throw new Exception('st_exportCheckAndRetrieve(): no viewable_pages was retrieved from CheckJobStatus'); 

Java Code

int checkCount = 0; 
int MAX_CHECKS = 40; 
int CHECK_INTERVAL = 6000; // 3 seconds 

/* Export check job status */ 
com.omniture.www.Saintresult[] exportCreateJobStatus = port.saintCheckJobStatus(Integer.parseInt(responseExportCreateJob)); 

/* Check status of export job */ 
while (!(exportCreateJobStatus[0].getStatus().equalsIgnoreCase("Completed") && exportCreateJobStatus[1].getStatus().equalsIgnoreCase("Ready"))) 
System.out.println("Current status for exportCreateJobStatus is: "+exportCreateJobStatus[0].getStatus()); 

if (checkCount >= MAX_CHECKS) 
throw new Exception("Report timeout: report hasn't returned after " + MAX_CHECKS + " status checks"); 
/* Export create job */ 
exportCreateJobStatus = port.saintCheckJobStatus(Integer.parseInt(responseExportCreateJob)); 

if (!(exportCreateJobStatus[0].getStatus().equalsIgnoreCase("Completed") && exportCreateJobStatus[1].getStatus().equalsIgnoreCase("Ready"))) 

Retrieving the Report Data

The export data files can be very large in size, so you can download them in batches or segments, also called pages earlier in this article.

The following code shows you how to use the Saint.ExportGetFileSegment() method to download the file in segments when the status returns the Ready string.

PHP Code

$data_set = array(); 
$data_set['data'] = array(); 

for ($i=1; $i <= $viewable_pages; $i++) { 
/* Saint.GetFileSegment */ 
$response = sendRequest('Saint.ExportGetFileSegment', array('file_id'=>$file_id, 'segment_id'=>$i ) ); 
echo "received chunk of " . count($response[0]['data']) . " rows.\n"; 
if (is_array($response) && is_array($response[0])) { 
if (!$data_set['header']) 
$data_set['header'] = $response[0]['header']; 

foreach($response[0]['data'] as $data_record){ 
$data_set['data'][] = $data_record['row']; 

Java Code

/* Loop to check export job status */ 
if (exportCreateJobStatus[0].getStatus().equalsIgnoreCase("Completed")) 
System.out.println("Current status for exportCreateJobStatus within if loop is: "+exportCreateJobStatus[0].getStatus()); 
System.out.println("Another status to check for exportCreateJobStatus within if loop: "+exportCreateJobStatus[1].getStatus()); 

/* Check to see status is Ready */ 
if (exportCreateJobStatus[1].getStatus().equalsIgnoreCase("Ready")) 
String fileID = exportCreateJobStatus[1].getType(); 

/* Get the number of viewable pages */ 
int viewablePages = exportCreateJobStatus[1].getViewable_pages(); 

System.out.println("File ID is: "+fileID+" and value of viewablePages is:"+viewablePages); 

/* Loop over the number of pages to retrieve file segment or data */ 
for(int i=0;i { 
com.omniture.www.Pagedetail[] responseExportGetFileSegment = port.saintExportGetFileSegment(Integer.parseInt(fileID), i); 

System.out.println("responseExportGetFileSegment retuned the follwing headers: "+responseExportGetFileSegment[0].getHeader()); 
System.out.println("responseExportGetFileSegment retuned the follwing data records: "+responseExportGetFileSegment[0].getData().length);