Gather Stats About Visitors.

If you don’t have another stats tool, you can start tracking vistors to your site with this simple 1 minute mod. Start by creating a new table called “stats”. Here is the schema:


```php #----------------------------

Table structure for stats

#----------------------------

CREATE TABLE stats (

id int(11) NOT NULL auto_increment,

userip varchar(100) NOT NULL default ‘’,

userbrowser varchar(255) NOT NULL default ‘’,

clickdate datetime NOT NULL default ‘0000-00-00 00:00:00’,

referralsite varchar(255) NOT NULL default ‘’,

page varchar(255) NOT NULL default ‘’,

PRIMARY KEY (id),

KEY clickdate (clickdate,userip)

) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;

#----------------------------

Records for table stats

#---------------------------- ```

In the file index.php, add this to the bottom:



```php mysql_query(“INSERT INTO stats

(userip,userbrowser,clickdate,referralsite,page) VALUES

(‘{$_SERVER[‘REMOTE_ADDR’]}’,‘{$_SERVER[‘HTTP_USER_AGENT’]}’,NOW(),‘{$_SERVER[‘REQUEST_URI’]}’,‘$target’)”) or die();

$results=mysql_query(“SELECT count(*) FROM stats”) or die();

if (mysql_result($results,0)>1000) {

mysql_query(“DELETE FROM stats”) or die();

}

?> ```



You can now access the table to see what your visitors are looking at and what the search engines are doing. The id column is used for the total number of hits at the time the entry was added. To keep the table from growing too large, it will purge itself once more the 1000 entries are made.

Hi sculptingstudio


[QUOTE]You can now access the table to see what your visitors are looking at and what the search engines are doing.[/QUOTE]



As in use MySQL and look through DB table or in admin.

[quote name=‘zardos’]As in use MySQL and look through DB table or in admin.[/QUOTE]As in PhpMyAdmin. A simple addon could be written for use in CS-Cart admin. Could even send the data over to jpgraph for a nice display.

Thanks sculptingstudio



Could be i nice addon for jpgraph, “Another super cool killer CS mod” :rolleyes:

Darn Larry, that will be super useful too. You have made some really incredible contributions to this community, thanks so much.



Both the CS-Cart admin mod and the graphing would be very welcomed too.

yes, another very useful mod. thank you thank you thank you.