You are here

public function AmpTrackingPixelAnalyticsService::getOutput in Analytics 7

Returns the output of the analytics service.

Parameters

array $context:

Return value

array A structured, renderable array.

Overrides AnalyticsServiceInterface::getOutput

File

analytics_amp/src/AmpTrackingPixelAnalyticsService.php, line 33

Class

AmpTrackingPixelAnalyticsService

Code

public function getOutput(array $context) {
  if (amp_is_amp_request()) {
    return array(
      '#theme' => 'html_tag',
      '#tag' => 'amp-pixel',
      '#attributes' => array(
        'id' => drupal_html_id('analytics_' . $this
          ->getMachineName()),
        'src' => $this
          ->getConfiguration()['url'],
      ),
    );
  }
}