OpenWetWare:Software/Extensions/Analytics/GoogleAnalytics: Difference between revisions
(New page: Note: This extension isn't currently turned on. The code needs to be modified to make it specific to OpenWetWare and not the private wikis. {{extension |name = Google Analytics |stat...) |
No edit summary |
||
Line 1: | Line 1: | ||
Note: This extension | Note: This extension is now turned on. The extension is not present in the DefaultExtensions.php file. It it only loaded for the OpenWetWare.org doamin. | ||
If anyone using a private wiki wants to get their own Google Analytics number, follow the directions below. The code muse be placed in the /wikis/<private wikiname>/WikiSettings.php file at the bottom. | |||
{{extension | {{extension | ||
Line 46: | Line 48: | ||
* Live Demo at http://www.PoxWiki.com/ | * Live Demo at http://www.PoxWiki.com/ | ||
[[Category: | [[Category:Extensions]] |
Revision as of 20:03, 21 November 2007
Note: This extension is now turned on. The extension is not present in the DefaultExtensions.php file. It it only loaded for the OpenWetWare.org doamin.
If anyone using a private wiki wants to get their own Google Analytics number, follow the directions below. The code muse be placed in the /wikis/<private wikiname>/WikiSettings.php file at the bottom.
Google Analytics Release status: stable | |
---|---|
Implementation | User activity |
Description | Automatically inserts Google Analytics tracking code at the bottom of MediaWiki pages |
Author(s) | Tim Laqua |
Last Version | 1.2 (08-26-2007) |
MediaWiki | 1.10+ |
License | No license specified |
Download | MediaWiki SVN |
Example | www.PoxWiki.com |
This extension inserts Google Analytics tracking code in every MediaWiki page that is viewed. The extension excludes pages being viewed by users with 'protect' privileges (sysops) and users with 'bot' privileges (bots) to prevent pollution of the statistics.
Installation
- Create a new folder (directory) in the following location:
wiki-install-folder/extensions/googleAnalytics - Download the googleAnalytics.php file from SVN
- Copy googleAnalytics.php in to the new googleAnalytics folder
- Add the following code to your LocalSettings.php at the bottom
<source lang="php">
//Replace xxxxxxx-x with YOUR GoogleAnalytics UA number $googleAnalytics = "UA-xxxxxxx-x";
//Set to true if you are using the Monobook skin (uses a Monobook-specific hook) //This setting is ignored for MW 1.11+ (SkinAfterBottomScripts is used instead) $googleAnalyticsMonobook = true;
require_once( "$IP/extensions/googleAnalytics/googleAnalytics.php" ); </source>
Usage
- Create a Google Analytics account
- Locate your UA number (found in the chunk of code that they provide you
_uacct=UA-xxxxxxx-x
- Follow Installation Instructions
- Google Analytics stats should start populating within 24-48 hours.
More info
- Live Demo at http://www.PoxWiki.com/