Difference between revisions of "Widget:GoogleAnalytics"

From www.coria-cfd.fr
Jump to: navigation, search
m (Protected "Widget:GoogleAnalytics" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
Line 10: Line 10:
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
</noinclude><includeonly><script type="text/javascript">
 
</noinclude><includeonly><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+
  var _gaq = _gaq || [];
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+
  _gaq.push(['_setAccount', '<!--{$tracker|escape:'html'}-->']);
</script>
+
  _gaq.push(['_trackPageview']);
<script type="text/javascript">
+
  (function() {
try {
+
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
var pageTracker = _gat._getTracker("<!--{$tracker|escape:'html'}-->");
+
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
pageTracker._trackPageview();
+
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
} catch(err) {}</script></includeonly>
+
  })();
 +
</script></includeonly>

Latest revision as of 15:27, 18 February 2011

This widget allows you to add Google Analytics to your wiki page.

It was created by V. Moureau.

Using this widget

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:GoogleAnalytics article.