class AutoLink in Googalytics - Google Analytics 8
Class AutoLink.
Hierarchy
- class \Drupal\ga\AnalyticsCommand\Generic implements DrupalSettingCommandsInterface uses DrupalSettingCommandsTrait
- class \Drupal\ga\AnalyticsCommand\Linker\AutoLink
Expanded class hierarchy of AutoLink
2 files declare their use of AutoLink
- AutoLinkTest.php in tests/
src/ Unit/ AnalyticsCommand/ Linker/ AutoLinkTest.php - DefaultCommandSubscriber.php in src/
EventSubscriber/ DefaultCommandSubscriber.php
File
- src/
AnalyticsCommand/ Linker/ AutoLink.php, line 10
Namespace
Drupal\ga\AnalyticsCommand\LinkerView source
class AutoLink extends Generic {
/**
* A list of domains.
*
* @var array
*/
protected $domains;
/**
* Add linker parameter to anchor rather than query.
*
* @var bool|null
*/
protected $useAnchor;
/**
* Add linker parameters to form submissions.
*
* @var bool|null
*/
protected $decorateForms;
/**
* Create constructor.
*
* @param array $domains
* A list of domains.
* @param bool|null $useAnchor
* Add linker parameter to anchor rather than query (optional).
* @param bool|null $decorateForms
* Add linker parameters to form submissions (optional).
* @param string $tracker_name
* The tracker name (optional).
* @param int $priority
* The command priority.
*/
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;
}
/**
* {@inheritdoc}
*/
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,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AutoLink:: |
protected | property | Add linker parameters to form submissions. | |
AutoLink:: |
protected | property | A list of domains. | |
AutoLink:: |
protected | property | Add linker parameter to anchor rather than query. | |
AutoLink:: |
public | function |
An array of commands to be sent to Google Analytics. Overrides Generic:: |
|
AutoLink:: |
public | function |
Create constructor. Overrides Generic:: |
|
DrupalSettingCommandsTrait:: |
protected | property | Priority integer. | |
DrupalSettingCommandsTrait:: |
public | function | An integer value for sorting by priority. | |
Generic:: |
protected | property | The command name. | |
Generic:: |
protected | property | A map of values for the command's fieldsObject parameter. | |
Generic:: |
protected | property | The name of the tracker for this command. | |
Generic:: |
constant | 4 | ||
Generic:: |
public | function | Get the command name. | |
Generic:: |
public | function | Get the map of values for the command's fieldsObject parameter. | |
Generic:: |
public | function | The tracker this command will be applied to, if specified. |