AutoLink.php in Googalytics - Google Analytics 8
File
src/AnalyticsCommand/Linker/AutoLink.php
View source
<?php
namespace Drupal\ga\AnalyticsCommand\Linker;
use Drupal\ga\AnalyticsCommand\Generic;
class AutoLink extends Generic {
protected $domains;
protected $useAnchor;
protected $decorateForms;
public function __construct(array $domains, $useAnchor = NULL, $decorateForms = NULL, $tracker_name = NULL, $priority = parent::DEFAULT_PRIORITY) {
parent::__construct('linker:autoLink', [], $tracker_name, $priority);
$this->domains = $domains;
$this->useAnchor = $useAnchor;
$this->decorateForms = $decorateForms;
}
public function getSettingCommands() {
$command = [
($this->trackerName ? $this->trackerName . '.' : '') . $this->command,
$this->domains,
];
if (!is_null($this->useAnchor)) {
$command[] = $this->useAnchor;
}
elseif (!is_null($this->decorateForms)) {
$command[] = FALSE;
}
if (!is_null($this->decorateForms)) {
$command[] = $this->decorateForms;
}
return [
$command,
];
}
}