|
1 | 1 | # b1 web analytics |
2 | 2 | A ready to use collection of php scripts for web analytics. |
3 | 3 |
|
4 | | -b1 analytics is a yet unfinished project based on php scripts I made in my past for analysing web traffic, feel free to leave feedback and use them for your own projects. Currently I have no concrete plans on finishing or continuing the project, but I'll use the time I have to fix bugs and keep it working. |
5 | | - |
6 | | -analyser.php and statistics.php are just experimental yet, but shall work. |
7 | | - |
8 | 4 | ## Why should I use b1 web analytics? |
9 | 5 | There are atleast 4 reasons: |
10 | 6 | * **it's server-sided** |
11 | 7 | * **it's independent** |
12 | 8 | * **it's open source** |
13 | 9 | * **it's free** |
14 | 10 |
|
15 | | -## Scripts |
16 | | -### analytics.php |
17 | | -The main script necessary for collecting and saving data, setting cookies, creating tables and identifying the visitors. |
18 | | -### database.php |
19 | | -Creates the database connection and holds settings |
20 | | -### example.php |
21 | | -An usage example, that outputs a script for additional tracking using echoscript() |
22 | | -### *analyser.php* |
23 | | -Holds functions for creating statistics, unfinished |
24 | | -### *statistics.php* |
25 | | -Simple website that shows statistics based on the collected data |
26 | | - |
27 | 11 | ## Usage |
28 | | -Before using the scripts you need to modify the mysql parameters (host, user, password, database) in database.php else none of the scripts will work. |
| 12 | +Before using the scripts you need to modify the mysql parameters (host, user, password, database) in database.php else none of the scripts will work: |
| 13 | + |
| 14 | +database.php |
| 15 | +```php |
| 16 | +// Creates database connection |
| 17 | +// Modify before use |
| 18 | +$b1_analytics_db = new mysqli("localhost", "user", "password", "database"); |
| 19 | +``` |
| 20 | + |
| 21 | +After that all you need to do is including tracker.php into your website to start collecting data: |
| 22 | +```php |
| 23 | +include "tracker.php"; |
| 24 | +``` |
29 | 25 |
|
30 | | -Use example.php as sample code for integrating analytics.php into your own scripts. |
31 | | -($b1_analytics->echoscript() is not necessary and might breaks the design of your website if used.) |
| 26 | +After collecting enough data you will see a simple report when opening statistics.php. |
32 | 27 |
|
33 | | -### Always remember to inform your users about data collection in your privacy policy! |
| 28 | +### PLEASE NOTE: b1 web tracking is still in development. We rely on your reporting of issues as well as donations! |
0 commit comments