Welcome Guest, Not a member yet? Register   Sign In
Visitors stats using CI
#1

[eluser]Mantero[/eluser]
how to count a visitors when they visit our site? what's the idea behind that?

*edit the title
#2

[eluser]BrianJM[/eluser]
Clicky
Google Analytics

Lots of others as well...
#3

[eluser]Mantero[/eluser]
erm sorry, I mean using CI, is there a way to do that instead using those already built tools?

I need to create my own visitors stat for my application
#4

[eluser]Unknown[/eluser]
look at http://ellislab.com/forums/viewthread/81644/P0/
#5

[eluser]InsiteFX[/eluser]
If you need to keep track of all visitors to site then you will need to
log them in as a visitor!

You will need an auth library and code to do this.

table vistors:
Code:
CREATE TABLE `visitors_online` (
  `ip_address`    varchar(16)             NOT NULL    DEFAULT '0',
  `timestamp`    int(11)        unsigned    NOT NULL,
  PRIMARY KEY (`ip_address`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;

When someone accesses your site you log them in as a vistor automatically!
Then if they login to your system you move them to the table below.
Also you need to log them into the auth users table and set the session data.

Table users_online:
Code:
CREATE TABLE `users_online` (
  `user_name`    varchar(40),
  `timestamp`    int(11)            unsigned    NOT NULL,
  PRIMARY KEY (`user_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;

I think I should really code this complete auth library up sometime!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB