public function Event::__construct in Googalytics - Google Analytics 8
Create constructor.
Parameters
string $event_category: The event category.
string $event_action: The event action.
string $event_label: The event label (optional).
int $event_value: The event value (optional).
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 Send::__construct
File
- src/
AnalyticsCommand/ Event.php, line 56
Class
- Event
- Class Event.
Namespace
Drupal\ga\AnalyticsCommandCode
public function __construct($event_category, $event_action, $event_label = NULL, $event_value = NULL, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
if (!is_null($event_value) && (!is_int($event_value) || $event_value < 0)) {
throw new \InvalidArgumentException("Event value must be a positive integer");
}
parent::__construct('event', $fields_object, $tracker_name, $priority);
$this->eventCategory = $event_category;
$this->eventAction = $event_action;
$this->eventLabel = $event_label;
$this->eventValue = $event_value;
}