You are here

protected function AcquiaLiftReportBase::buildAllConversionReports in Acquia Lift Connector 7

Builds the conversion reports to show basic conversion metrics for report requested in the report_data.

Parameters

array $report_data: The loaded report data for the selection decision and dates.

Return value

array The render array for the report.

2 calls to AcquiaLiftReportBase::buildAllConversionReports()
AcquiaLiftABReport::buildCampaignReports in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentReportInterface::buildCampaignReports().
AcquiaLiftReport::buildCampaignReports in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentReportInterface::buildCampaignReports().

File

plugins/agent_types/AcquiaLiftAgent.inc, line 1555
Provides an agent type for Acquia Lift

Class

AcquiaLiftReportBase
Base class providing report data loading functionality common to all Acquia Lift Reports.

Code

protected function buildAllConversionReports($report_data) {
  if (empty($report_data['goal'])) {

    // Generate the conversion reports for all goals.
    $reports = $this
      ->buildConversionReports(array(
      'name' => t('All goals'),
      'detail' => $report_data['conversion_all']['detail'],
      'summary' => $report_data['conversion_all']['summary'],
    ), $report_data);
  }
  else {

    // Generate the conversion reports for the specified goal.
    $reports = $this
      ->buildConversionReports($report_data['conversion_goals'][$report_data['goal']], $report_data);
  }
  if ($reports == FALSE) {
    drupal_set_message(t('There was a problem retrieving the report data.  Please try again later.'), 'error');
  }
  $build['reports'] = array(
    '#type' => 'container',
    '#attributes' => array(
      'class' => array(
        'lift-statistics',
      ),
    ),
    'conversion' => $reports,
  );
  return $build;
}