Difference between revisions of "Piwik"
Line 19: | Line 19: | ||
Haha, I could not get to work Piwik yet. Therefore I've added GA tracking to Mediawiki template/skin footer. | Haha, I could not get to work Piwik yet. Therefore I've added GA tracking to Mediawiki template/skin footer. | ||
# | #Navigate to your current skin directory <tt>/wikimedia-dir/skins/</tt> | ||
#In my example Vector skin file is <tt>/wikimedia-dir/skins/Vector.php</tt> | #In my example ''Vector skin'' file is <tt>/wikimedia-dir/skins/Vector.php</tt> | ||
#Edit within vim <code>vim Vector.php</code> press <tt>/</tt> for search and type <tt><!-- footer --></tt> press enter | #Edit within vim <code>vim Vector.php</code> press <tt>/</tt> for search and type <tt><nowiki><!-- footer --></nowiki></tt> press enter | ||
#Paste <span style="color: green">Google Analytics's script</span> code | #Paste <span style="color: green">Google Analytics's script</span> code | ||
<pre><nowiki> | |||
<!-- footer --> | <!-- footer --> | ||
<div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>> | <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>> | ||
Line 42: | Line 43: | ||
<--! further footer code ommitted --> | <--! further footer code ommitted --> | ||
</nowiki></pre> |
Revision as of 23:21, 7 January 2014
Error after adding Pwiki extension ...
Warning: require_once( /extensions/piwik/Piwik.php) [function.require-once]: failed to open stream: No such file or directory in /home/pio2pio/domains/pio2pio.vot.pl/public_html/wiki2/LocalSettings.php on line 141 Fatal error: require_once() [function.require]: Failed opening required ' /extensions/piwik/Piwik.php' (include_path='.:/usr/local/php5.3/lib/php') in /home/pio2pio/domains/pio2pio.vot.pl/public_html/wiki2/LocalSettings.php on line 141
Lines added to /home/pio2pio/public_html/wiki2/LocalSettings.php at the end of the file as per Piwik Integration extension.
# Add more configuration options below. require_once(" /extensions/piwik/Piwik.php" ); $wgPiwikURL = "piwik.linuxpl.com/"; $wgPiwikIDSite = "6763";
Admin direct reports: PHP 5.2.17 version the same as: <?php phpinfo(); ?>
. But Wikimedia special pages claims version 5.3.17 Special:Version
I found following on the Piwik forum: "Tell your hosting provider to use php_value to set the PHP include path. Piwik needs to set the include path so that Zend Framework files can be found. Your hosting provider uses php_admin_value to set the PHP include path. As of PHP 5.2.5, this cannot be overridden by a php_value setting in your .htaccess file or by a PHP script, such as Piwik."
Google Analitics tracking Mediawiki
Haha, I could not get to work Piwik yet. Therefore I've added GA tracking to Mediawiki template/skin footer.
- Navigate to your current skin directory /wikimedia-dir/skins/
- In my example Vector skin file is /wikimedia-dir/skins/Vector.php
- Edit within vim
vim Vector.php
press / for search and type <!-- footer --> press enter - Paste Google Analytics's script code
<!-- footer --> <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>> <span style="color: green"><script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-47922123-1', 'vot.pl'); ga('send', 'pageview'); </script></span> <?php foreach( $this->getFooterLinks() as $category => $links ): ?> <ul id="footer-<?php echo $category ?>"> <--! further footer code ommitted -->