Changeset 1936 for plugins/googleTools/_public.php
- Timestamp:
- 12/03/09 14:31:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/googleTools/_public.php
r1695 r1936 23 23 public static function publicHeadContent(&$core) 24 24 { 25 $res = ''; 26 25 27 if ($core->blog->settings->googlestuff_verify != "") { 26 $res = '<meta name="google-site-verification" content="'.$core->blog->settings->googlestuff_verify.'" />'."\n"; 27 echo $res; 28 $res .= '<meta name="google-site-verification" content="'.$core->blog->settings->googlestuff_verify.'" />'."\n"; 28 29 } 30 31 if ($core->blog->settings->googlestuff_uacct != "") { 32 $res .= '<script type="text/javascript">'."\n". 33 'var _gaq = _gaq || [];'."\n". 34 '_gaq.push([\'_setAccount\', \''.$core->blog->settings->googlestuff_uacct.'\']);'."\n". 35 '_gaq.push([\'_trackPageview\']);'."\n". 36 '</script>'."\n"; 37 } 38 39 echo $res; 29 40 } 30 41 … … 33 44 if ($core->blog->settings->googlestuff_uacct != "") { 34 45 $res = '<script type="text/javascript">'."\n". 35 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");'."\n". 36 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));'."\n". 37 '</script>'."\n". 38 '<script type="text/javascript">'."\n". 39 'if (typeof(_gat) != "undefined") {'."\n". 40 ' var pageTracker = _gat._getTracker("'. 41 $core->blog->settings->googlestuff_uacct. 42 '");'."\n". 43 ' pageTracker._initData();'."\n". 44 ' pageTracker._trackPageview();'."\n". 45 '}'."\n". 46 '</script>'."\n"; 46 '(function() {'."\n". 47 'var ga = document.createElement(\'script\');'."\n". 48 'ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' :'. 49 '\'http://www\') + \'.google-analytics.com/ga.js\';'."\n". 50 'ga.setAttribute(\'async\', \'true\');'."\n". 51 'document.documentElement.firstChild.appendChild(ga);'."\n". 52 '})();'."\n". 53 '</script>'; 54 47 55 echo $res; 48 56 }
Note: See TracChangeset
for help on using the changeset viewer.