Commits

Sam Stenvall  committed 3896346

added support for specifying the domain name used for GATC cookies

  • Participants
  • Parent commits d6297df

Comments (0)

Files changed (1)

File components/GoogleAnalytics.php

 	 * @var string currency for the e-commerce tracking.
 	 */
 	public $currency;
+	
+	/**
+	 * @var string the domain for GATC cookies
+	 */
+	public $cookieDomain;
+	
 	/**
 	 * @var GATransaction[] list of registered transactions.
 	 */
 _gaq.push(['_trackPageview']);
 EOD;
 
+		if(isset($this->cookieDomain))
+			$headScript .= "\n_gaq.push(['_setDomainName', '{$this->cookieDomain}']);";
+
 		$bodyEndScript = $this->getTransactionsJS();
 		$bodyEndScript .= <<<EOD