Set.php in Googalytics - Google Analytics 8
File
src/AnalyticsCommand/Set.php
View source
<?php
namespace Drupal\ga\AnalyticsCommand;
class Set extends Generic {
const DEFAULT_PRIORITY = 100;
protected $settingKey;
protected $settingValue;
public function __construct($setting_key, $value, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
parent::__construct('set', $fields_object, $tracker_name, $priority);
$this->settingKey = $setting_key;
$this->settingValue = $value;
}
public function getSettingKey() {
return $this->settingKey;
}
public function getSettingValue() {
return $this->settingValue;
}
public function getSettingCommands() {
$command = [
($this->trackerName ? $this->trackerName . '.' : '') . $this->command,
$this->settingKey,
$this->settingValue,
];
if (!empty($this->fieldsObject)) {
$command[] = $this->fieldsObject;
}
return [
$command,
];
}
}