You are here

public function GoogleAnalyticsGa::getOutput in Analytics 8

Returns the output of the analytics service.

Return value

array A structured, renderable array.

Overrides ServicePluginBase::getOutput

File

analytics_google/src/Plugin/AnalyticsService/GoogleAnalyticsGa.php, line 46

Class

GoogleAnalyticsGa
Analytics service type.

Namespace

Drupal\analytics_google\Plugin\AnalyticsService

Code

public function getOutput() {
  $output = [];

  // This is just placeholder code.
  $output['analytics_' . $this
    ->getServiceId()] = [
    '#type' => 'html_tag',
    '#tag' => 'googleanalytics',
    '#attributes' => [
      'tracking_id' => $this->configuration['id'],
    ],
  ];
  return $output;
}