[pLog-svn] r6124 - plugins/branches/lifetype-1.2/googleanalytics
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Mon Dec 24 13:35:30 EST 2007
Author: jondaley
Date: 2007-12-24 13:35:29 -0500 (Mon, 24 Dec 2007)
New Revision: 6124
Modified:
plugins/branches/lifetype-1.2/googleanalytics/plugingoogleanalytics.class.php
Log:
user submitted new javascript: http://bugs.lifetype.net/view.php?id=1436 See my notes on bugs.lifetype before I'll submit this to sourceforge. thanks mouson
Modified: plugins/branches/lifetype-1.2/googleanalytics/plugingoogleanalytics.class.php
===================================================================
--- plugins/branches/lifetype-1.2/googleanalytics/plugingoogleanalytics.class.php 2007-12-22 20:02:40 UTC (rev 6123)
+++ plugins/branches/lifetype-1.2/googleanalytics/plugingoogleanalytics.class.php 2007-12-24 18:35:29 UTC (rev 6124)
@@ -17,7 +17,7 @@
$this->id = "googleanalytics";
$this->author = "lss";
$this->desc = "This plugin offers features to inset google analytics javascript codes in tempalte header";
- $this->version = "20070302";
+ $this->version = "20071224";
$this->locales = Array( "en_UK" , "zh_TW" , "zh_CN", "es_ES", "fr_FR" );
@@ -45,23 +45,29 @@
{
return $this->pluginEnabled;
}
-
- /**
- * Returns google analytics javascript
+
+ /**
+ * Returns google analytics javascript Ga.js
*/
function getJavascriptCode(){
$jsCode = "";
if( $this->isEnabled() ){
- $jsCode ="<script "
- ."src=\"http://www.google-analytics.com/urchin.js\" "
- ."type=\"text/javascript\">\n"
- ."</script>\n"
- ."<script type=\"text/javascript\">\n"
- ."_uacct = \"".$this->uacct."\";\n"
- ."urchinTracker();\n"
- ."</script>\n";
+ $jsCode ="<script type=\"text/javascript\">\n"
+ ."var gaJsHost = ((\"https:\" == "
+ ."document.location.protocol) ? \"https://ssl.\" "
+ .": \"http://www.\");\n"
+ ."document.write(unescape(\"%3Cscript src='\" "
+ ." + gaJsHost + \"google-analytics.com/ga.js' "
+ ."type='text/javascript'%3E%3C/script%3E\"));\n"
+ ."</script>\n"
+ ."<script type=\"text/javascript\">\n"
+ ."var pageTracker = _gat._getTracker(\"".$this->uacct."\");\n"
+ ."pageTracker._initData();\n"
+ ."pageTracker._trackPageview();\n"
+ ."</script>\n";
}
return $jsCode;
}
+
}
?>
More information about the pLog-svn
mailing list