public function getBody()
	{
		if (!$this->getOption('code'))
		{
			throw new UnexpectedValueException('A Google Analytics tracking code is required.');
		}

		$prefix = $this->isSecure() ? 'https://ssl' : 'http://www';
		$code = $this->getOption('code');

		if ($this->isAsync())
		{
			$output = '<script type="text/javascript">';
			$output .= '(function() {';
			$output .= 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;';
			$output .= "ga.src = '{$prefix}.google-analytics.com/ga.js';";
			$output .= 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);';
			$output .= '})();';
			$output .= '</script>';
		}
		else
		{
			$output = '<script type="text/javascript">';
			$output .= "document.write(unescape(\"%3Cscript src='{$prefix}.google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));";
			$output .= '</script>';
			$output .= '<script type="text/javascript">';
			$output .= 'try{';
			$output .= "var pageTracker = _gat._getTracker('{$code}');";

			foreach ($this->listCalls() as $call)
			{
				$output .= $this->createCall($call['name'], $call['params']);
			}

			$output .= 'pageTracker._trackPageview();';
			$output .= '} catch(err) {}</script>';
		}

		return $output;
	}
public function getBody()
	{
		if (!$this->getOption('code'))
		{
			throw new UnexpectedValueException('A Google Analytics tracking code is required.');
		}

		$prefix = $this->isSecure() ? 'https://ssl' : 'http://www';
		$code = $this->getOption('code');

		if ($this->isAsync())
		{
			$output = '<script type="text/javascript">';
			$output .= '(function() {';
			$output .= 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;';
			$output .= "ga.src = '{$prefix}.google-analytics.com/ga.js';";
			$output .= 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);';
			$output .= '})();';
			$output .= '</script>';
		}
		else
		{
			$output = '<script type="text/javascript">';
			$output .= "document.write(unescape(\"%3Cscript src='{$prefix}.google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));";
			$output .= '</script>';
			$output .= '<script type="text/javascript">';
			$output .= 'try{';
			$output .= "var pageTracker = _gat._getTracker('{$code}');";

			foreach ($this->listCalls() as $call)
			{
				$output .= $this->createCall($call['name'], $call['params']);
			}

			$output .= 'pageTracker._trackPageview();';
			$output .= '} catch(err) {}</script>';
		}

		return $output;
	}
public function getBody ( ) { if ( ! $ this -> getOption ( 'code' ) ) { throw new UnexpectedValueException ( 'A Google Analytics tracking code is required.' ) ; } $ prefix = $ this -> isSecure ( ) ? 'https://ssl' : 'http://www' ; $ code = $ this -> getOption ( 'code' ) ; if ( $ this -> isAsync ( ) ) { $ output = '<script type="text/javascript">' ; $ output .= '(function() {' ; $ output .= 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;' ; $ output .= "ga.src = '{$prefix}.google-analytics.com/ga.js';" ; $ output .= 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);' ; $ output .= '})();' ; $ output .= '</script>' ; } else { $ output = '<script type="text/javascript">' ; $ output .= "document.write(unescape(\"%3Cscript src='{$prefix}.google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));" ; $ output .= '</script>' ; $ output .= '<script type="text/javascript">' ; $ output .= 'try{' ; $ output .= "var pageTracker = _gat._getTracker('{$code}');" ; foreach ( $ this -> listCalls ( ) as $ call ) { $ output .= $ this -> createCall ( $ call [ 'name' ] , $ call [ 'params' ] ) ; } $ output .= 'pageTracker._trackPageview();' ; $ output .= '} catch(err) {}</script>' ; } return $ output ; }
Google Analytics only needs to be included in the header

@return  null

@since   1.0
@throws  UnexpectedValueException
Google Analytics only needs to be included in the header