You are here

public function Timing::getSettingCommands in Googalytics - Google Analytics 8

An array of commands to be sent to Google Analytics.

Return value

array An array of command values.

Overrides Send::getSettingCommands

File

src/AnalyticsCommand/Timing.php, line 71

Class

Timing
Class Timing.

Namespace

Drupal\ga\AnalyticsCommand

Code

public function getSettingCommands() {
  $command = [
    ($this->trackerName ? $this->trackerName . '.' : '') . $this->command,
    $this->hitType,
    $this->timingCategory,
    $this->timingVar,
    $this->timingValue,
  ];
  if (!is_null($this->timingLabel)) {
    $command[] = $this->timingLabel;
  }
  if (!empty($this->fieldsObject)) {
    $command[] = $this->fieldsObject;
  }
  return [
    $command,
  ];
}