You are here

protected function AcquiaLiftReport::loadReportData in Acquia Lift Connector 7

Loads all of the data necessary to generate the reports for the agent.

Parameters

$options: An array of report filter options.

  • decision: Preselected decision to display.
  • start: The start date of the report.
  • from: The end date of the report.
  • goal: (optional) A selected goal for reporting; defaults to all.
  • conversion_metric: (optional) Metric to display within the conversion report. One of 'rate' (conversion rate) or 'value' (conversion value).

Return value

array The reporting data for the date range as an array with keys for

  • status: The general agent status report data
  • confidence: The confidence report data
  • targeting: The targeting report data
1 call to AcquiaLiftReport::loadReportData()
AcquiaLiftReport::buildCampaignReports in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentReportInterface::buildCampaignReports().

File

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

Class

AcquiaLiftReport
Responsible retrieving and generating reports on the Acquia Lift agent.

Code

protected function loadReportData($options) {
  $report_data = $this
    ->generateReportConfiguration($options);
  $this
    ->loadConversionReportData($report_data);

  // Context filters.
  if (!isset($report_data['potential_context'])) {
    $this
      ->loadContextFilterData($report_data);
    if (isset($report_data['raw']['potential_context']['error'])) {
      $report_data['potential_context'] = FALSE;
    }
    else {
      $report_data['potential_context'] = $this
        ->extractPotentialTargetingValues($report_data['raw']['potential_context']['data']);
    }
  }

  // Agent status
  if (!isset($report_data['status'])) {
    $this
      ->loadAgentStatusData($report_data);
    if (isset($report_data['raw']['status']['error'])) {
      $report_data['status'] = FALSE;
    }
    else {
      $report_data['status'] = $this
        ->extractOverviewReportData($report_data['raw']['status']['data'][$report_data['machine_name']]);
    }
  }

  // Confidence report data.
  if (!isset($report_data['confidence'])) {
    $this
      ->loadConfidenceData($report_data);
    if (isset($report_data['raw']['confidence']['error'])) {
      $report_data['confidence'] = FALSE;
    }
    else {
      $report_data['confidence'] = $this
        ->extractConfidenceReportData($report_data['raw']['confidence']['data']['items']);
    }
  }

  // Targeting report data.
  if (!isset($report_data['targeting'])) {
    $this
      ->loadTargetingData($report_data);
    if (isset($report_data['raw']['targeting']['error']) || !isset($report_data['raw']['targeting']['data']['items'])) {
      $report_data['targeting'] = FALSE;
    }
    else {
      $report_data['targeting'] = $this
        ->extractTargetingReportData($report_data['raw']['targeting']['data']['items']);
    }
  }
  if (!isset($report_data['extracted_total'])) {

    // Combine data to form all campaign report data.
    $this
      ->extractCampaignReportData($report_data);
  }
  return $report_data;
}