ENHANCEMENT Added Google Analytics (fixes #6349)

git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@115537 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2011-01-13 20:20:04 +00:00
parent b01a11f6d2
commit 6dca3d4c48
2 changed files with 21 additions and 0 deletions

View File

@ -49,3 +49,8 @@ try{
// We want this to be reviewed by the whole community
BasicAuth::protect_entire_site(false);
Object::add_extension('DocumentationViewer', 'DocumentationViewerExtension');
if(Director::isLive()) {
DocumentationViewerExtension::$google_analytics_code = 'UA-84547-8';
}

View File

@ -82,5 +82,21 @@
<p>Documentation powered by <a href="http://www.silverstripe.org">SilverStripe</a>. <a href="http://github.com/chillu/silverstripe-doc-restructuring">Contribute to the Documentation Project</a>.
<br />Except where otherwise noted, content on this wiki is licensed under <a class="urlextern" rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">CC Attribution-Noncommercial-Share Alike 3.0 Unported</a><a href="http://creativecommons.org/licenses/by/3.0/nz/" rel="license"><img class="ccLogo" src="http://i.creativecommons.org/l/by/3.0/nz/80x15.png" style="border-width: 0pt;" alt="Creative Commons License"></a></p>
</div>
<% if GoogleAnalyticsCode %>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '$GoogleAnalyticsCode']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<% end_if %>
</body>
</html>