Simple stats collection with CodeIgniter hooks - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Simple stats collection with CodeIgniter hooks (/showthread.php?tid=62419) |
Simple stats collection with CodeIgniter hooks - Hyper-X - 07-13-2015 Hi. After hours of googling I find an idea to track users journey throughout the site and to get some quantitative data on on the usage of the application. For example, I want to know when they get connected, the pages they visited (even the functions they called). This is how I proceed. 1) in application/config/config.php I replace this line : Code: $config['enable_hooks'] = FALSE; Code: $config['enable_hooks'] = TRUE; Code: $hook['post_controller_constructor'] = array( CREATE TABLE `audit` ( `auditId` int(11) NOT NULL AUTO_INCREMENT, `userId` varchar(100) NOT NULL, `adresseIp` varchar(100) NOT NULL, `referer` varchar(200) DEFAULT NULL, `controller` varchar(50) DEFAULT NULL, `fonction` varchar(100) DEFAULT NULL, `url` varchar(250) DEFAULT NULL, `navigator` varchar(100) NOT NULL, `dateAction` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `domain` varchar(100) DEFAULT NULL, `pageCourant` varchar(200) DEFAULT NULL, PRIMARY KEY (`auditId`) ) 4) Here is my controller: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); But I get this error: Unable to locate the specified class: Session.php Why? Please help. Here is the tutorial i follow:http://7degrees.co.uk/blog/simple-stats-collection-with-codeigniter-hooks/ RE: Simple stats collection with CodeIgniter hooks - gadelat - 07-13-2015 Please increase your log_treshold in your config and paste here a log RE: Simple stats collection with CodeIgniter hooks - Hyper-X - 07-13-2015 (07-13-2015, 02:10 AM)gadelat Wrote: Please increase your log_treshold in your config and paste here a log Thanks gadelat. but i'm a newbie in CI. Would you like me to post the contents of the config file? RE: Simple stats collection with CodeIgniter hooks - kenjis - 07-13-2015 You don't follow the tutorial. You can't extend CI_Controller. RE: Simple stats collection with CodeIgniter hooks - Hyper-X - 07-13-2015 (07-13-2015, 03:55 AM)kenjis Wrote: You don't follow the tutorial. Thank you a lot. I did not notice it. Now it works. thank you |