You are here

public function Send::__construct in Googalytics - Google Analytics 8

Send constructor.

Parameters

string $hit_type: The event hitType.

array $fields_object: A map of values for the command's fieldsObject parameter.

string $tracker_name: The tracker name (optional).

int $priority: The command priority.

Overrides Generic::__construct

4 calls to Send::__construct()
Event::__construct in src/AnalyticsCommand/Event.php
Create constructor.
Exception::__construct in src/AnalyticsCommand/Exception.php
Exception constructor.
Pageview::__construct in src/AnalyticsCommand/Pageview.php
Create constructor.
Timing::__construct in src/AnalyticsCommand/Timing.php
Create constructor.
4 methods override Send::__construct()
Event::__construct in src/AnalyticsCommand/Event.php
Create constructor.
Exception::__construct in src/AnalyticsCommand/Exception.php
Exception constructor.
Pageview::__construct in src/AnalyticsCommand/Pageview.php
Create constructor.
Timing::__construct in src/AnalyticsCommand/Timing.php
Create constructor.

File

src/AnalyticsCommand/Send.php, line 39

Class

Send
Class Send.

Namespace

Drupal\ga\AnalyticsCommand

Code

public function __construct($hit_type, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
  if (!in_array($hit_type, self::$hitTypes)) {
    throw new \InvalidArgumentException("Invalid hit type specified.");
  }
  parent::__construct('send', $fields_object, $tracker_name, $priority);
  $this->hitType = $hit_type;
}