public function trackPage($page = null, $title = null, $type = self::TYPE_PAGEVIEW)
	{
		if (!defined('self::TYPE_'. strtoupper($type))) {
			throw new AnalyticsArgumentException('Type variable can\'t be of this type.');
		}

		$item = "ga('send', 'pageview');";

		if ($page !== null || $title !== null) {
			$page = ($page === null ? "window.location.href" : "'{$page}'");
			$title = ($title === null ? "document.title" : "'{$title}'");
			$item = "ga('send', { 'hitType': '{$type}', 'page': {$page}, 'title': {$title} });";
		}

		$this->addItem($item);
	}
public function trackPage($page = null, $title = null, $type = self::TYPE_PAGEVIEW)
	{
		if (!defined('self::TYPE_'. strtoupper($type))) {
			throw new AnalyticsArgumentException('Type variable can\'t be of this type.');
		}

		$item = "ga('send', 'pageview');";

		if ($page !== null || $title !== null) {
			$page = ($page === null ? "window.location.href" : "'{$page}'");
			$title = ($title === null ? "document.title" : "'{$title}'");
			$item = "ga('send', { 'hitType': '{$type}', 'page': {$page}, 'title': {$title} });";
		}

		$this->addItem($item);
	}
public function trackPage ( $ page = null , $ title = null , $ type = self :: TYPE_PAGEVIEW ) { if ( ! defined ( 'self::TYPE_' . strtoupper ( $ type ) ) ) { throw new AnalyticsArgumentException ( 'Type variable can\'t be of this type.' ) ; } $ item = "ga('send', 'pageview');" ; if ( $ page !== null || $ title !== null ) { $ page = ( $ page === null ? "window.location.href" : "'{$page}'" ) ; $ title = ( $ title === null ? "document.title" : "'{$title}'" ) ; $ item = "ga('send', { 'hitType': '{$type}', 'page': {$page}, 'title': {$title} });" ; } $ this -> addItem ( $ item ) ; }
Track a page view.

@param string $page
@param string $title
@param string $type

@throws AnalyticsArgumentException

@return void
Track a page view .