public function render()
	{
		if (!$this->isEnabled()) {
			return;
		}

		if ($this->isAutomatic()) {
			$this->addItem("ga('send', '" . self::TYPE_PAGEVIEW . "');");
		}

		if ($this->isAnonymised()) {
			$this->addItem("ga('set', 'anonymizeIp', true);");
		}

		if ($this->application->environment() === 'dev') {
			$this->addItem("ga('create', '{$this->id}', { 'cookieDomain': 'none' });");
		} else {
			$this->addItem("ga('create', '{$this->id}', '{$this->domain}');");
		}

		return $this->view->make('googlitics::analytics')->withItems(array_reverse($this->getItems()))->render();
	}
public function render()
	{
		if (!$this->isEnabled()) {
			return;
		}

		if ($this->isAutomatic()) {
			$this->addItem("ga('send', '" . self::TYPE_PAGEVIEW . "');");
		}

		if ($this->isAnonymised()) {
			$this->addItem("ga('set', 'anonymizeIp', true);");
		}

		if ($this->application->environment() === 'dev') {
			$this->addItem("ga('create', '{$this->id}', { 'cookieDomain': 'none' });");
		} else {
			$this->addItem("ga('create', '{$this->id}', '{$this->domain}');");
		}

		return $this->view->make('googlitics::analytics')->withItems(array_reverse($this->getItems()))->render();
	}
public function render ( ) { if ( ! $ this -> isEnabled ( ) ) { return ; } if ( $ this -> isAutomatic ( ) ) { $ this -> addItem ( "ga('send', '" . self :: TYPE_PAGEVIEW . "');" ) ; } if ( $ this -> isAnonymised ( ) ) { $ this -> addItem ( "ga('set', 'anonymizeIp', true);" ) ; } if ( $ this -> application -> environment ( ) === 'dev' ) { $ this -> addItem ( "ga('create', '{$this->id}', { 'cookieDomain': 'none' });" ) ; } else { $ this -> addItem ( "ga('create', '{$this->id}', '{$this->domain}');" ) ; } return $ this -> view -> make ( 'googlitics::analytics' ) -> withItems ( array_reverse ( $ this -> getItems ( ) ) ) -> render ( ) ; }
Renders and returns Google Analytics code.

@return string
Renders and returns Google Analytics code .