Difference between revisions of "Piwik"

From Ever changing code
Jump to navigation Jump to search
(Created page with "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 /hom...")
 
 
(4 intermediate revisions by the same user not shown)
Line 15: Line 15:
Piwik needs to set the include path so that Zend Framework files can be found.
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."
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 <tt>/wikimedia-dir/skins/</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><nowiki><!-- footer --></nowiki></tt> press enter
#Paste <span style="color: green">Google Analytics's script</span> code
<<nowiki>!</nowiki>-- 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 -->
= References =
[http://m.mediawiki.org/wiki/Extension:Piwik_Integration Mediawiki Extension:Piwik] ver 2.2.2 (2013-06-14)

Latest revision as of 00:31, 8 July 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.

  1. Navigate to your current skin directory /wikimedia-dir/skins/
  2. In my example Vector skin file is /wikimedia-dir/skins/Vector.php
  3. Edit within vim vim Vector.php press / for search and type <!-- footer --> press enter
  4. Paste Google Analytics's script code
<!-- footer -->
<div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>

        <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>

        <?php foreach( $this->getFooterLinks() as $category => $links ): ?>
                <ul id="footer-<?php echo $category ?>">	
<--! further footer code ommitted -->

References

Mediawiki Extension:Piwik ver 2.2.2 (2013-06-14)