-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the ComputerAnalytics wiki!
Here you'll learn a bit about the Analytics process!
ComputerAnalytics is inspired by Google Analytics. It's basically an open source analytics software with which you can see the traffic on your website.
Every Analytic is stored in a seperate file in the servers directory. Analytics can only be recieved if the server is on. However if you get the analytics from somewhere else you can import them
We'll devide this into 2 sections:
- where you are on the website including everything in the address bar
- When you opened the site and when you closed it
- From which site you came
This data is being collected in this file
- Your IP adress (to count the amount of persons accessing the website)
- Your User Agent (aka browser)
This data is being collected in the Function Recieve
in AnalyticsData
which is at the time or writing here
After you started the server as an Administrator open http://localhost:502/
. Then get the master token from the config file in the analytics folder and log in. Then add the website you want to collect statistics on. Copy its private token and then log in with that token. Now you can click links or the boxes to filter for that specific value (referrer, host, endpoint, query string, date).
To see my implementation on https://computerelite.github.io check here
If you host your Website with ComputerUtils Webserver
simply add this project as a reference and do following
HttpServer server = new HttpServer(); // If you already have a server setup you don't need to create a new one
AnalyticsServer analyticsServer = new AnalyticsServer();
server.StartServer(502); // The argument of the function is the port the server will be running on.
analyticsServer.AddToServer(server); // This will add every endpoint needed for analytics to your server
Then in your html files add the js file /analytics.js
:
<script src="/analytics.js?origin=https://yoursite.com">
You'll have to edit the analytics script and then add it to your site. Edit this file:
- Remove
const analyticsHosts = [{0}]
from the file. - Change the last line with code to
navigator.sendBeacon("http://yourNiceSiteWhichIsHostingComputerAnalytics/analytics", blob)
where you replace the link with the right one.
If you cannot host a C# server I reccommend looking at the implementation of my site
Create a GitHub issue and describe your problem as well as you can