You are here

protected function AcquiaLiftReportBase::loadConversionReportData in Acquia Lift Connector 7

Loads and formats the necessary reporting data in order to generate a conversion metrics graph/report.

Parameters

array: The report data object to load conversion report data into.

2 calls to AcquiaLiftReportBase::loadConversionReportData()
AcquiaLiftABReport::buildCampaignReports in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentReportInterface::buildCampaignReports().
AcquiaLiftReport::loadReportData in plugins/agent_types/AcquiaLiftAgent.inc
Loads all of the data necessary to generate the reports for the agent.

File

plugins/agent_types/AcquiaLiftAgent.inc, line 1752
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 loadConversionReportData(&$report_data) {

  // All goals - summary report is always loaded in order to get the overview
  // data for the campaign.
  if (!isset($report_data['conversion'])) {
    $this
      ->loadConversionReportHelper($report_data, FALSE);
  }

  // All goals conversion report.
  if (empty($report_data['goal'])) {

    // All goals - detail report.
    if (!isset($report_data['conversion_detail'])) {
      $this
        ->loadConversionReportHelper($report_data, TRUE);
    }
    return;
  }

  // Load the detail and summary reports for the specified goal.
  $actions = visitor_actions_get_actions();
  $goal_id = $report_data['goal'];
  if (!isset($report_data['conversion_goals'][$goal_id])) {
    $report_data['conversion_goals'][$goal_id]['name'] = isset($actions[$goal_id]) ? $actions[$goal_id]['label'] : $goal_id;
    $options['goal'] = $goal_id;

    // Summary report.
    $this
      ->loadConversionReportHelper($report_data, FALSE, $options);

    // Detail report.
    $this
      ->loadConversionReportHelper($report_data, TRUE, $options);
  }
}