public function trackMetric($category, array $options = [])
	{
		$item = "ga('send', 'event', '{$category}'";

		if (!empty($options)) {
			$item .= ", 'action', { ";

			foreach ($options as $key => $value) {
				$item .= "'{$key}': {$value}, ";
			}

			$item = rtrim($item, ', ') . " }";
		}

		$item .= ");";
		$this->addItem($item);
	}
public function trackMetric($category, array $options = [])
	{
		$item = "ga('send', 'event', '{$category}'";

		if (!empty($options)) {
			$item .= ", 'action', { ";

			foreach ($options as $key => $value) {
				$item .= "'{$key}': {$value}, ";
			}

			$item = rtrim($item, ', ') . " }";
		}

		$item .= ");";
		$this->addItem($item);
	}
public function trackMetric ( $ category , array $ options = [ ] ) { $ item = "ga('send', 'event', '{$category}'" ; if ( ! empty ( $ options ) ) { $ item .= ", 'action', { " ; foreach ( $ options as $ key => $ value ) { $ item .= "'{$key}': {$value}, " ; } $ item = rtrim ( $ item , ', ' ) . " }" ; } $ item .= ");" ; $ this -> addItem ( $ item ) ; }
Track a metric.

@param string $category
@param array  $options

@return void
Track a metric .