Skip to content

AnalyticsService

Defines an analytics service plugin attribute.


  • Full name: \Drupal\analytics\Attribute\AnalyticsService
  • Parent class: Plugin

See Also:

  • \Drupal\analytics\AnalyticsServiceManager
  • \Drupal\analytics\Plugin\ServicePluginInterface
  • \Drupal\analytics\Attribute\plugin_api

Properties

id

public string $id

label

public \Drupal\Core\StringTranslation\TranslatableMarkup $label

multiple

public bool $multiple

deriver

public ?string $deriver

deprecated

public ?string $deprecated

additionalSources

public bool $additionalSources

Methods

__construct

Constructs an AnalyticsService attribute.

public __construct(string $id, \Drupal\Core\StringTranslation\TranslatableMarkup $label, bool $multiple = false, class-string|null $deriver = null, string|null $deprecated = null, bool $additionalSources = false): mixed

Parameters:

Parameter Type Description
$id string
The plugin ID.
$label \Drupal\Core\StringTranslation\TranslatableMarkup
The label of the service.
$multiple bool
Whether a site can have more than one instance of the service.
$deriver class-string|null
(optional) The deriver class.
$deprecated string|null
(optional) A deprecation message, in the format of @trigger_error()
messages, if the plugin is deprecated. Deprecated plugins aren't offered
for new services, trigger the message when they're created, and are
listed on the status report.
$additionalSources bool
(optional) Whether the service can load scripts, images or frames from
hosts set up in the service rather than in Drupal, such as the tags in a
tag manager's container. With the Content Security Policy module, the
service form then reminds site builders to add those hosts.